{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitbybit-dev/json-schema/bitbybit-dev-unfold-solid-to-flat-body-schema.json",
  "title": "UnfoldSolidToFlatBody",
  "description": "Flatten every constant-thickness sheet-metal solid in an uploaded STEP file to flat patterns.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitbybit-dev-openapi.json#/components/schemas/UnfoldSolidToFlatBody",
  "type": "object",
  "properties": {
    "stepFileId": {
      "type": "string",
      "minLength": 1,
      "description": "ID of the previously uploaded STEP file (returned by the file upload endpoint). Both plain STEP (.step/.stp) and gzip-compressed STEP (.stpz) uploads are accepted - compression is detected automatically."
    },
    "kFactor": {
      "default": 0.5,
      "description": "Sheet-metal K-factor (neutral-axis position), typically ~0.5.",
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "thicknessOverride": {
      "default": 0,
      "description": "Sheet thickness override in model units; 0 auto-detects thickness from face pairs.",
      "type": "number",
      "minimum": 0
    },
    "outputs": {
      "description": "Output formats for the flattened patterns. Every solid's flat is combined into one compound output per format. Defaults to glTF.",
      "$ref": "#/$defs/OutputOptions"
    }
  },
  "required": [
    "stepFileId"
  ],
  "additionalProperties": false,
  "$defs": {
    "MeshPrecision": {
      "type": "number",
      "minimum": 0.0001,
      "maximum": 10,
      "description": "Mesh tessellation precision (lower = finer). Range: [0.0001, 10]"
    },
    "OutputFormat": {
      "type": "string",
      "enum": [
        "step",
        "stpz",
        "decomposed-mesh",
        "gltf"
      ],
      "description": "Output file format: 'step' (raw STEP), 'stpz' (gzip-compressed STEP), 'decomposed-mesh' (triangulated JSON), 'gltf' (glTF 2.0 binary .glb). Note: 'step' and 'stpz' are mutually exclusive - choose one or the other, not both."
    },
    "OutputOptions": {
      "type": "object",
      "properties": {
        "formats": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/$defs/OutputFormat"
          },
          "description": "Output formats to generate. Multiple formats can be requested (e.g. ['gltf', 'stpz']) - each produces a separate downloadable result. Do not include both 'step' and 'stpz' - only one STEP variant is supported per request."
        },
        "meshPrecision": {
          "description": "Tessellation precision for mesh-based outputs (decomposed-mesh and gltf). Lower values produce denser meshes. Only ignored when output is limited to step/stpz formats.",
          "$ref": "#/$defs/MeshPrecision"
        },
        "gltfMeshPrecision": {
          "description": "Override tessellation precision specifically for glTF output. When set, takes precedence over meshPrecision for glTF only.",
          "$ref": "#/$defs/MeshPrecision"
        },
        "adjustYtoZ": {
          "description": "Convert from Y-up to Z-up coordinate system in the output. Useful for software that expects Z-up.",
          "type": "boolean"
        }
      },
      "required": [
        "formats"
      ],
      "additionalProperties": false,
      "description": "Controls which output formats are generated and their quality settings"
    }
  }
}