{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitbybit-dev/json-schema/bitbybit-dev-dragon-cup-body-schema.json",
  "title": "DragonCupBody",
  "description": "Request body for the Dragon Cup model",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitbybit-dev-models-dragon-cup-api-openapi.yml#/components/schemas/DragonCupBody",
  "type": "object",
  "properties": {
    "params": {
      "$ref": "#/$defs/DragonCupParams"
    },
    "outputs": {
      "$ref": "#/$defs/OutputOptions"
    }
  },
  "required": [
    "outputs"
  ],
  "additionalProperties": false,
  "$defs": {
    "DragonCupParams": {
      "type": "object",
      "properties": {
        "height": {
          "description": "Total cup height (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "radiusBottom": {
          "description": "Radius at the base (cm)",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 30
        },
        "radiusTopOffset": {
          "description": "How much the top radius differs from bottom",
          "type": "number",
          "minimum": 0,
          "maximum": 20
        },
        "radiusMidOffset": {
          "description": "Mid-section radius offset",
          "type": "number",
          "minimum": 0,
          "maximum": 20
        },
        "rotationTopAngle": {
          "description": "Top twist angle (degrees)",
          "type": "number",
          "minimum": -360,
          "maximum": 360
        },
        "rotationMidAngle": {
          "description": "Mid twist angle (degrees)",
          "type": "number",
          "minimum": -360,
          "maximum": 360
        },
        "nrSkinCellsVertical": {
          "description": "Vertical skin cell count",
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 30
        },
        "nrSkinCellsHorizontal": {
          "description": "Horizontal skin cell count",
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 50
        },
        "nrSkinCellDivisionsTop": {
          "description": "Subdivisions at top of each cell",
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 10
        },
        "nrSkinCellDivisionsBottom": {
          "description": "Subdivisions at bottom of each cell",
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 10
        },
        "skinCellOuterHeight": {
          "description": "Outer cell extrusion height",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "skinCellInnerHeight": {
          "description": "Inner cell extrusion height",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "skinCellBottomHeight": {
          "description": "Bottom cell height",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "skinCellTopHeight": {
          "description": "Top cell height",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "thickness": {
          "description": "Shell wall thickness",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "bottomThickness": {
          "description": "Bottom plate thickness",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 5
        },
        "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": "Dragon Cup model parameters - all optional, sane defaults apply"
    },
    "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"
    },
    "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]"
    }
  }
}