{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitbybit-dev/json-schema/bitbybit-dev-phone-nest-body-schema.json",
  "title": "PhoneNestBody",
  "description": "Request body for the Phone Nest model",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitbybit-dev-models-phone-nest-api-openapi.yml#/components/schemas/PhoneNestBody",
  "type": "object",
  "properties": {
    "params": {
      "$ref": "#/$defs/PhoneNestParams"
    },
    "outputs": {
      "$ref": "#/$defs/OutputOptions"
    }
  },
  "required": [
    "outputs"
  ],
  "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"
    },
    "PhoneNestParams": {
      "type": "object",
      "properties": {
        "heightBottom": {
          "description": "Height of the bottom section (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "heightTop": {
          "description": "Height of the top section (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "widthBack": {
          "description": "Width at the back (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "widthFront": {
          "description": "Width at the front (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "length": {
          "description": "Depth / length (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "backOffset": {
          "description": "Back curve offset (cm)",
          "type": "number",
          "minimum": 0,
          "maximum": 30
        },
        "thickness": {
          "description": "Shell wall thickness",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "applyOrnaments": {
          "description": "Add decorative perforations to the surface",
          "type": "boolean"
        },
        "filletRadius": {
          "description": "Fillet radius on loft edges",
          "type": "number",
          "minimum": 0,
          "maximum": 15
        },
        "phoneHeight": {
          "description": "Phone mock-up height (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 35
        },
        "phoneWidth": {
          "description": "Phone mock-up width (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 35
        },
        "phoneThickness": {
          "description": "Phone mock-up thickness (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 3
        },
        "precision": {
          "description": "Geometry precision (lower = finer)",
          "$ref": "#/$defs/MeshPrecision"
        },
        "rotation": {
          "description": "Final rotation angle (degrees)",
          "type": "number",
          "minimum": -360,
          "maximum": 360
        },
        "scale": {
          "description": "Uniform scale factor",
          "$ref": "#/$defs/PositiveScale"
        },
        "origin": {
          "description": "[x, y, z] placement origin",
          "$ref": "#/$defs/Point3"
        },
        "direction": {
          "description": "[x, y, z] up direction",
          "$ref": "#/$defs/Point3"
        }
      },
      "additionalProperties": false,
      "description": "Phone Nest model parameters - all optional, sane defaults apply"
    },
    "Point3": {
      "type": "array",
      "prefixItems": [
        {
          "type": "number",
          "minimum": -1000,
          "maximum": 1000
        },
        {
          "type": "number",
          "minimum": -1000,
          "maximum": 1000
        },
        {
          "type": "number",
          "minimum": -1000,
          "maximum": 1000
        }
      ],
      "description": "3D point as [x, y, z] tuple, each coordinate in [-1000, 1000]"
    },
    "PositiveScale": {
      "type": "number",
      "minimum": 1e-06,
      "maximum": 1000,
      "description": "Uniform scale factor. Range: [1e-6, 1000]"
    }
  }
}