Skip to content

Check assembly fit

Verify CSG assembly interference, pairwise clearances with closest-point witnesses, and axis-aligned insertion sweeps. Minimal example: {"parts":[{"name":"a","model":{"type":"box","size":[10,10,10]}},{"name":"b","model":{"type":"translate","vector":[12,0,0],"child":{"type":"box","size":[10,10,10]}}}]}

Call

curl --fail-with-body --silent --show-error --request POST --header 'Content-Type: application/json' --header 'Accept: application/json' --data-raw '{"parts":[{"name":"a","model":{"type":"box","size":[10,10,10]}},{"name":"b","model":{"type":"translate","vector":[12,0,0],"child":{"type":"box","size":[10,10,10]}}}]}' https://cad.burgeonads.com/v1/check/assembly-fit

Input schema

{
  "$defs": {
    "CsgNode": {
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "box"
              }
            }
          },
          "then": {
            "required": [
              "size"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "cylinder"
              }
            }
          },
          "then": {
            "required": [
              "radius",
              "height"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "sphere"
              }
            }
          },
          "then": {
            "required": [
              "radius"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "extrude"
              }
            }
          },
          "then": {
            "required": [
              "polygon",
              "height"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "revolve"
              }
            }
          },
          "then": {
            "required": [
              "profile"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "translate"
              }
            }
          },
          "then": {
            "required": [
              "vector",
              "child"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "rotate"
              }
            }
          },
          "then": {
            "required": [
              "angles_deg",
              "child"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "scale"
              }
            }
          },
          "then": {
            "required": [
              "factor",
              "child"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "mirror"
              }
            }
          },
          "then": {
            "required": [
              "normal",
              "child"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "union",
                  "difference",
                  "intersection"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "children": {
                "minItems": 2
              }
            },
            "required": [
              "children"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "hull"
              }
            }
          },
          "then": {
            "required": [
              "children"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "offset_2d"
              }
            }
          },
          "then": {
            "required": [
              "delta_mm",
              "child"
            ]
          }
        }
      ],
      "properties": {
        "angle_deg": {
          "default": 360,
          "maximum": 360,
          "minimum": 0.001,
          "type": "number"
        },
        "angles_deg": {
          "$ref": "#/$defs/Vec3"
        },
        "center": {
          "type": "boolean"
        },
        "child": {
          "$ref": "#/$defs/CsgNode"
        },
        "children": {
          "items": {
            "$ref": "#/$defs/CsgNode"
          },
          "minItems": 1,
          "type": "array"
        },
        "delta_mm": {
          "$ref": "#/$defs/Num"
        },
        "factor": {
          "items": {
            "maximum": 1000,
            "minimum": -1000,
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "fillet_mm": {
          "maximum": 10000,
          "minimum": 0,
          "type": "number"
        },
        "height": {
          "$ref": "#/$defs/Pos"
        },
        "holes": {
          "items": {
            "$ref": "#/$defs/Ring"
          },
          "type": "array"
        },
        "join": {
          "default": "round",
          "enum": [
            "round",
            "miter",
            "square"
          ]
        },
        "normal": {
          "$ref": "#/$defs/Vec3"
        },
        "polygon": {
          "$ref": "#/$defs/Ring"
        },
        "profile": {
          "$ref": "#/$defs/Ring"
        },
        "radius": {
          "anyOf": [
            {
              "$ref": "#/$defs/Pos"
            },
            {
              "items": {
                "maximum": 10000,
                "minimum": 0,
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            }
          ]
        },
        "scale_top": {
          "default": [
            1,
            1
          ],
          "items": {
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "segments": {
          "$ref": "#/$defs/Seg"
        },
        "size": {
          "items": {
            "$ref": "#/$defs/Pos"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "twist_deg": {
          "maximum": 360,
          "minimum": -360,
          "type": "number"
        },
        "type": {
          "enum": [
            "box",
            "cylinder",
            "sphere",
            "extrude",
            "revolve",
            "translate",
            "rotate",
            "scale",
            "mirror",
            "union",
            "difference",
            "intersection",
            "hull",
            "offset_2d"
          ]
        },
        "vector": {
          "$ref": "#/$defs/Vec3"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "Mm50": {
      "maximum": 50,
      "minimum": 0,
      "type": "number"
    },
    "Name": {
      "pattern": "^[A-Za-z0-9_.-]{1,64}$",
      "type": "string"
    },
    "Num": {
      "maximum": 10000,
      "minimum": -10000,
      "type": "number"
    },
    "Pos": {
      "maximum": 10000,
      "minimum": 0.001,
      "type": "number"
    },
    "Ring": {
      "items": {
        "items": {
          "$ref": "#/$defs/Num"
        },
        "maxItems": 2,
        "minItems": 2,
        "type": "array"
      },
      "maxItems": 256,
      "minItems": 3,
      "type": "array"
    },
    "Seg": {
      "default": 32,
      "maximum": 96,
      "minimum": 3,
      "type": "integer"
    },
    "Vec3": {
      "items": {
        "$ref": "#/$defs/Num"
      },
      "maxItems": 3,
      "minItems": 3,
      "type": "array"
    }
  },
  "additionalProperties": false,
  "properties": {
    "insertion_checks": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "direction": {
            "$ref": "#/$defs/Vec3"
          },
          "part": {
            "$ref": "#/$defs/Name"
          }
        },
        "required": [
          "part",
          "direction"
        ],
        "type": "object"
      },
      "maxItems": 16,
      "type": "array"
    },
    "min_clearance_mm": {
      "default": 0.2,
      "maximum": 50,
      "minimum": 0,
      "type": "number"
    },
    "pair_rules": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "allow_contact": {
            "default": false,
            "type": "boolean"
          },
          "max_gap_mm": {
            "$ref": "#/$defs/Mm50"
          },
          "min_clearance_mm": {
            "$ref": "#/$defs/Mm50"
          },
          "part_a": {
            "$ref": "#/$defs/Name"
          },
          "part_b": {
            "$ref": "#/$defs/Name"
          }
        },
        "required": [
          "part_a",
          "part_b"
        ],
        "type": "object"
      },
      "maxItems": 120,
      "type": "array"
    },
    "parts": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "model": {
            "$ref": "#/$defs/CsgNode"
          },
          "name": {
            "$ref": "#/$defs/Name"
          },
          "role": {
            "default": "solid",
            "enum": [
              "solid",
              "keepout"
            ]
          }
        },
        "required": [
          "name",
          "model"
        ],
        "type": "object"
      },
      "maxItems": 16,
      "minItems": 2,
      "type": "array"
    },
    "timeout_ms": {
      "default": 5000,
      "maximum": 8000,
      "minimum": 100,
      "type": "integer"
    }
  },
  "required": [
    "parts"
  ],
  "type": "object"
}

Output schema

{
  "$defs": {
    "BoxMm": {
      "properties": {
        "max_mm": {
          "$ref": "#/$defs/V3"
        },
        "min_mm": {
          "$ref": "#/$defs/V3"
        }
      },
      "required": [
        "min_mm",
        "max_mm"
      ],
      "type": "object"
    },
    "Collision": {
      "properties": {
        "part": {
          "type": "string"
        },
        "point_mm": {
          "$ref": "#/$defs/V3"
        }
      },
      "required": [
        "part",
        "point_mm"
      ],
      "type": "object"
    },
    "InsertionResult": {
      "properties": {
        "blocking_parts": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "clear": {
          "type": "boolean"
        },
        "collisions": {
          "items": {
            "$ref": "#/$defs/Collision"
          },
          "type": "array"
        },
        "direction": {
          "$ref": "#/$defs/V3"
        },
        "part": {
          "type": "string"
        }
      },
      "required": [
        "part",
        "direction",
        "clear",
        "blocking_parts",
        "collisions"
      ],
      "type": "object"
    },
    "PairResult": {
      "properties": {
        "allow_contact": {
          "type": "boolean"
        },
        "clearance_ok": {
          "type": "boolean"
        },
        "closest_points_mm": {
          "items": {
            "$ref": "#/$defs/V3"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": [
            "array",
            "null"
          ]
        },
        "gap_ok": {
          "type": "boolean"
        },
        "intersection_bbox": {
          "anyOf": [
            {
              "$ref": "#/$defs/BoxMm"
            },
            {
              "type": "null"
            }
          ]
        },
        "intersection_volume_mm3": {
          "minimum": 0,
          "type": "number"
        },
        "intersects": {
          "type": "boolean"
        },
        "max_gap_mm": {
          "type": [
            "number",
            "null"
          ]
        },
        "min_distance_mm": {
          "minimum": 0,
          "type": [
            "number",
            "null"
          ]
        },
        "part_a": {
          "type": "string"
        },
        "part_b": {
          "type": "string"
        },
        "required_clearance_mm": {
          "minimum": 0,
          "type": "number"
        },
        "witness_point_mm": {
          "$ref": "#/$defs/V3N"
        }
      },
      "required": [
        "part_a",
        "part_b",
        "required_clearance_mm",
        "max_gap_mm",
        "allow_contact",
        "intersects",
        "intersection_volume_mm3",
        "intersection_bbox",
        "witness_point_mm",
        "min_distance_mm",
        "closest_points_mm",
        "clearance_ok",
        "gap_ok"
      ],
      "type": "object"
    },
    "V3": {
      "items": {
        "type": "number"
      },
      "maxItems": 3,
      "minItems": 3,
      "type": "array"
    },
    "V3N": {
      "items": {
        "type": "number"
      },
      "maxItems": 3,
      "minItems": 3,
      "type": [
        "array",
        "null"
      ]
    }
  },
  "properties": {
    "distance_search_mm": {
      "type": "number"
    },
    "fit_ok": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "insertion_results": {
      "items": {
        "$ref": "#/$defs/InsertionResult"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "pair_results": {
      "items": {
        "$ref": "#/$defs/PairResult"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "status": {
      "enum": [
        "ok",
        "timeout",
        "unknown"
      ]
    },
    "verified": {
      "type": "boolean"
    }
  },
  "required": [
    "status",
    "verified",
    "fit_ok",
    "distance_search_mm",
    "pair_results",
    "insertion_results"
  ],
  "type": "object"
}

Limits

Default timeout: 5000 ms. Maximum timeout: 8000 ms.

{
  "annotations": {
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false,
    "readOnlyHint": true,
    "title": "Check assembly fit"
  },
  "price_micro_usdc": 20000,
  "timeout_result": {
    "distance_search_mm": 60.0,
    "fit_ok": null,
    "insertion_results": null,
    "pair_results": null,
    "status": "timeout",
    "verified": false
  }
}

Examples

Geometric verification only. Not structural or safety certification. Provided as-is without warranty.