Files
cdsl-cad/backend/engine/cdsl_engine/cdsl_schema.json
T

1335 lines
64 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cdsl.local/schema/cad.cdsl.llm.v1",
"title": "CDSL semantic document",
"description": "Complete self-contained CDSL. Runtime-supported operations can be rebuilt by the local CDSL-only engine; deferred operations are retained for future engine implementations.",
"type": "object",
"properties": {
"schema": {"enum": ["cad.cdsl.llm.v1", "cad.runtime.v1"]},
"schema_version": {"type": "string"},
"kind": {"type": "string", "minLength": 1},
"part_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{3,80}$"},
"meta": {
"type": "object",
"properties": {
"derived_metrics": {"$ref": "#/$defs/derivedMetrics"}
},
"additionalProperties": true
},
"bodies": {"type": "array", "items": {"$ref": "#/$defs/runtimeBody"}},
"geometry": {
"type": "object",
"properties": {
"sketches": {"type": "array", "items": {"$ref": "#/$defs/sketch"}}
},
"required": ["sketches"],
"additionalProperties": false
},
"features": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/feature"}}
},
"required": ["schema", "geometry", "features"],
"additionalProperties": false,
"$defs": {
"metricSnapshot": {
"type": "object",
"properties": {
"volume_mm3": {"type": "number"},
"surface_area_mm2": {"type": "number"},
"bbox_mm": {"type": "array", "items": {"type": "number"}, "minItems": 6, "maxItems": 6},
"solid_count": {"type": "integer", "minimum": 0},
"face_count": {"type": "integer", "minimum": 0},
"edge_count": {"type": "integer", "minimum": 0},
"vertex_count": {"type": "integer", "minimum": 0},
"hole_count": {"type": "integer", "minimum": 0},
"fillet_count": {"type": "integer", "minimum": 0},
"face_type_distribution": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 0}}
},
"required": ["volume_mm3", "surface_area_mm2", "bbox_mm", "solid_count", "face_count", "edge_count", "vertex_count", "hole_count", "fillet_count", "face_type_distribution"],
"additionalProperties": false
},
"metricDelta": {
"type": "object",
"properties": {
"volume_mm3": {"type": "number"},
"surface_area_mm2": {"type": "number"},
"face_count": {"type": "integer"},
"hole_count": {"type": "integer"}
},
"required": ["volume_mm3", "surface_area_mm2", "face_count", "hole_count"],
"additionalProperties": false
},
"derivedMetrics": {
"type": "object",
"properties": {
"engine": {"type": "string", "minLength": 1},
"engine_build": {"type": "string", "minLength": 1},
"generated_at": {"type": "string", "minLength": 1},
"final": {"$ref": "#/$defs/metricSnapshot"},
"per_feature": {
"type": "array",
"items": {
"type": "object",
"properties": {
"feature_id": {"type": "string", "minLength": 1},
"atomic_id": {"$ref": "#/$defs/feature_atomic_ids"},
"status": {"type": "string", "minLength": 1},
"after": {"$ref": "#/$defs/metricSnapshot"},
"delta": {"$ref": "#/$defs/metricDelta"}
},
"required": ["feature_id", "atomic_id", "status", "after", "delta"],
"additionalProperties": false
}
},
"atomic_histogram": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 0}}
},
"required": ["engine", "final", "per_feature", "atomic_histogram"],
"additionalProperties": false
},
"featureIntent": {
"type": "object",
"properties": {
"label": {"type": "string", "pattern": "^[a-z][a-z0-9_]{2,63}$"},
"summary": {"type": "string", "minLength": 1, "maxLength": 80},
"why": {"type": "string", "minLength": 1, "maxLength": 400},
"ties_to_requirement": {"type": "string", "pattern": "^[A-Za-z0-9_.:-]{1,80}$"},
"provenance": {"enum": ["authored", "annotated", "imported"]}
},
"required": ["summary", "provenance"],
"additionalProperties": false
},
"number": {"type": "number"},
"positive": {"type": "number", "exclusiveMinimum": 0},
"positiveInteger": {"type": "integer", "minimum": 1},
"runtimeBody": {
"type": "object",
"properties": {
"id": {"type": "string", "pattern": "^body_[0-9]{3}$"},
"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$"}
},
"required": ["id", "name"],
"additionalProperties": false
},
"point2": {"type": "array", "items": {"$ref": "#/$defs/number"}, "minItems": 2, "maxItems": 2},
"point3": {"type": "array", "items": {"$ref": "#/$defs/number"}, "minItems": 3, "maxItems": 3},
"circleItem": {
"type": "object",
"properties": {"center": {"$ref": "#/$defs/point2"}, "radius_mm": {"$ref": "#/$defs/positive"}},
"required": ["radius_mm"],
"additionalProperties": false
},
"workplane": {
"type": "object",
"properties": {
"origin_mm": {"$ref": "#/$defs/point3"},
"x_dir": {"$ref": "#/$defs/point3"},
"y_dir": {"$ref": "#/$defs/point3"},
"normal": {"$ref": "#/$defs/point3"}
},
"required": ["origin_mm", "x_dir", "normal"],
"additionalProperties": false
},
"hostFace": {
"oneOf": [
{
"type": "object",
"properties": {
"frame": {
"type": "object",
"properties": {
"origin_mm": {"$ref": "#/$defs/point3"},
"x_dir": {"$ref": "#/$defs/point3"},
"y_dir": {"$ref": "#/$defs/point3"},
"normal": {"$ref": "#/$defs/point3"}
},
"required": ["origin_mm", "x_dir", "y_dir", "normal"],
"additionalProperties": false
}
},
"required": ["frame"],
"additionalProperties": false
},
{"$ref": "#/$defs/selectorRef"}
]
},
"holePosition": {
"type": "object",
"properties": {"mm": {"$ref": "#/$defs/point3"}},
"required": ["mm"],
"additionalProperties": false
},
"axis": {
"type": "object",
"properties": {"origin_mm": {"$ref": "#/$defs/point3"}, "direction": {"$ref": "#/$defs/point3"}, "selector": {"$ref": "#/$defs/selectorRef"}, "unresolved": {"type": "string", "minLength": 1}},
"anyOf": [{"required": ["origin_mm", "direction"]}, {"required": ["selector"]}, {"required": ["unresolved"]}],
"additionalProperties": false
},
"endCondition": {
"type": "object",
"properties": {
"type": {"type": "string", "minLength": 1},
"solidworks_code": {"type": "integer"},
"reference": {"oneOf": [{"$ref": "#/$defs/selectorRef"}, {"$ref": "#/$defs/sourceVertexDatumRef"}]},
"offset_mm": {"type": "number", "minimum": 0}
},
"required": ["type", "solidworks_code"],
"additionalProperties": false
},
"sourceVertexDatumRef": {
"type": "object",
"properties": {
"kind": {"const": "source_vertex"},
"source_sketch_id": {"type": "string", "minLength": 1, "maxLength": 160},
"source_entity_id": {"type": "string", "minLength": 1, "maxLength": 160},
"point_mm": {"$ref": "#/$defs/point3"}
},
"required": ["kind", "source_sketch_id", "source_entity_id", "point_mm"],
"additionalProperties": false
},
"selectorOrUnresolved": {
"oneOf": [
{"$ref": "#/$defs/selectorRef"},
{"type": "object", "properties": {"unresolved": {"type": "string", "minLength": 1}}, "required": ["unresolved"], "additionalProperties": false}
]
},
"extrudeParams": {
"type": "object",
"properties": {"distance_mm": {"$ref": "#/$defs/number"}, "reverse": {"type": "boolean"}, "reverse_distance_mm": {"$ref": "#/$defs/number"}, "end_condition": {"$ref": "#/$defs/endCondition"}, "reverse_end_condition": {"$ref": "#/$defs/endCondition"}, "draft": {"$ref": "#/$defs/extrudeDraft"}, "result_mode": {"enum": ["fuse", "new_body"]}},
"required": ["distance_mm"],
"additionalProperties": false
},
"extrudeFromFaceParams": {
"type": "object",
"properties": {"distance_mm": {"$ref": "#/$defs/number"}, "operation": {"enum": ["add", "cut"]}, "reverse": {"type": "boolean"}, "reverse_distance_mm": {"$ref": "#/$defs/number"}, "two_sided": {"type": "boolean"}, "end_condition": {"$ref": "#/$defs/endCondition"}, "reverse_end_condition": {"$ref": "#/$defs/endCondition"}, "draft": {"$ref": "#/$defs/extrudeDraft"}, "result_mode": {"enum": ["fuse", "new_body"]}},
"required": ["distance_mm", "operation"],
"additionalProperties": false
},
"extrudeDraft": {
"type": "object",
"properties": {"angle_deg": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 90}, "pull_direction": {"type": "boolean"}},
"required": ["angle_deg", "pull_direction"],
"additionalProperties": false
},
"extrudeCutThroughParams": {
"type": "object",
"properties": {"reverse": {"type": "boolean"}, "end_condition": {"$ref": "#/$defs/endCondition"}},
"required": ["end_condition"],
"additionalProperties": false
},
"loftParams": {
"type": "object",
"properties": {
"profile_sketch_ids": {
"type": "array",
"minItems": 2,
"maxItems": 16,
"uniqueItems": true,
"items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}
},
"initial_output_roles": {"type": "boolean"},
"cap_output_profile_sources": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}
}
},
"required": ["profile_sketch_ids"],
"additionalProperties": false
},
"loftCapFaceParams": {
"type": "object",
"properties": {
"profile_sketch_ids": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"uniqueItems": true,
"items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}
}
},
"required": ["profile_sketch_ids"],
"additionalProperties": false
},
"sweepPath": {
"oneOf": [
{
"type": "object",
"properties": {
"workplane": {"$ref": "#/$defs/workplane"},
"segment": {"$ref": "#/$defs/analyticSegment"},
"segments": {
"type": "array",
"minItems": 2,
"items": {"$ref": "#/$defs/analyticSegment"}
}
},
"required": ["workplane"],
"oneOf": [
{"required": ["segment"], "not": {"required": ["segments"]}},
{"required": ["segments"], "not": {"required": ["segment"]}}
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"segments": {
"type": "array",
"minItems": 2,
"items": {"$ref": "#/$defs/spatialSweepSegment"}
}
},
"required": ["segments"],
"additionalProperties": false
}
]
},
"sweepParams": {
"type": "object",
"properties": {
"path": {"$ref": "#/$defs/sweepPath"},
"is_frenet": {"type": "boolean"},
"result_mode": {"enum": ["fuse", "new_body"]},
"initial_output_roles": {"type": "boolean"},
"cap_output_contract": {
"type": "object",
"properties": {
"profile_source": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"profile_entity": {"type": "string", "minLength": 1, "maxLength": 160},
"path_source": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"path_entity": {"type": "string", "minLength": 1, "maxLength": 160},
"path_reversed": {"type": "boolean"}
},
"required": ["profile_source", "profile_entity", "path_source", "path_entity", "path_reversed"],
"additionalProperties": false
},
"swept_face_contract": {
"type": "object",
"properties": {
"profile_source": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"profile_entities": {
"type": "array",
"items": {"type": "string", "minLength": 1, "maxLength": 160},
"minItems": 1,
"uniqueItems": true
},
"path_source": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"path_entity": {"type": "string", "minLength": 1, "maxLength": 160},
"path_reversed": {"type": "boolean"}
},
"required": ["profile_source", "profile_entities", "path_source", "path_entity", "path_reversed"],
"additionalProperties": false
},
"swept_edge_contract": {
"type": "object",
"properties": {
"profile_source": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"profile_entities": {
"type": "array",
"items": {"type": "string", "minLength": 1, "maxLength": 160},
"minItems": 2,
"uniqueItems": true
},
"path_source": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"path_entity": {"type": "string", "minLength": 1, "maxLength": 160},
"path_reversed": {"type": "boolean"}
},
"required": ["profile_source", "profile_entities", "path_source", "path_entity", "path_reversed"],
"additionalProperties": false
}
},
"required": ["path"],
"additionalProperties": false
},
"revolveParams": {
"type": "object",
"properties": {"angle_deg": {"type": "number", "minimum": 0, "maximum": 360}, "axis": {"$ref": "#/$defs/axis"}, "reverse": {"type": "boolean"}, "end_condition": {"$ref": "#/$defs/endCondition"}, "result_mode": {"enum": ["fuse", "new_body"]}},
"required": ["angle_deg", "axis"],
"additionalProperties": false
},
"revolveSurfaceParams": {
"type": "object",
"properties": {"angle_deg": {"type": "number", "minimum": 0, "maximum": 360}, "axis": {"$ref": "#/$defs/axis"}, "reverse": {"type": "boolean"}},
"required": ["angle_deg", "axis"],
"additionalProperties": false
},
"extrudeSurfaceParams": {
"type": "object",
"properties": {"distance_mm": {"type": "number", "exclusiveMinimum": 0}, "reverse": {"type": "boolean"}, "reverse_distance_mm": {"type": "number", "exclusiveMinimum": 0}},
"required": ["distance_mm"],
"additionalProperties": false
},
"sphereParams": {
"type": "object",
"properties": {
"radius_mm": {"$ref": "#/$defs/positive"},
"center_mm": {"$ref": "#/$defs/point3"},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["radius_mm", "center_mm"],
"additionalProperties": false
},
"boxParams": {
"type": "object",
"properties": {
"length_mm": {"$ref": "#/$defs/positive"},
"width_mm": {"$ref": "#/$defs/positive"},
"height_mm": {"$ref": "#/$defs/positive"},
"center_mm": {"$ref": "#/$defs/point3"},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["length_mm", "width_mm", "height_mm", "center_mm"],
"additionalProperties": false
},
"cylinderParams": {
"type": "object",
"properties": {
"radius_mm": {"$ref": "#/$defs/positive"},
"height_mm": {"$ref": "#/$defs/positive"},
"axis": {"$ref": "#/$defs/axis"},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["radius_mm", "height_mm"],
"additionalProperties": false
},
"bendChainLeg": {
"type": "object",
"properties": {
"leg_mm": {"$ref": "#/$defs/positive"},
"bend_angle_deg": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 180},
"inner_radius_mm": {"type": "number", "minimum": 0},
"side": {"type": "integer", "enum": [1, -1]}
},
"required": ["leg_mm"],
"additionalProperties": false
},
"bendAddParams": {
"type": "object",
"properties": {
"thickness_mm": {"$ref": "#/$defs/positive"},
"width_mm": {"$ref": "#/$defs/positive"},
"chain": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/bendChainLeg"}},
"frame": {
"type": "object",
"properties": {
"origin_mm": {"$ref": "#/$defs/point3"},
"x_dir": {"$ref": "#/$defs/point3"},
"y_dir": {"$ref": "#/$defs/point3"},
"normal": {"$ref": "#/$defs/point3"}
},
"required": ["origin_mm", "x_dir", "y_dir", "normal"],
"additionalProperties": false
},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["thickness_mm", "width_mm", "chain"],
"additionalProperties": false
},
"gearAddParams": {
"type": "object",
"properties": {
"module_mm": {"$ref": "#/$defs/positive"},
"teeth_count": {"type": "integer", "minimum": 8, "maximum": 200},
"width_mm": {"$ref": "#/$defs/positive"},
"axis": {"$ref": "#/$defs/axis"},
"helix_angle_rad": {"type": "number", "minimum": 0, "exclusiveMaximum": 0.7853981633974483},
"pressure_angle_rad": {"type": "number", "exclusiveMinimum": 0, "maximum": 0.6108652381980153},
"herringbone": {"type": "boolean"},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["module_mm", "teeth_count", "width_mm", "axis"],
"additionalProperties": false
},
"rackAddParams": {
"type": "object",
"properties": {
"module_mm": {"$ref": "#/$defs/positive"},
"teeth_count": {"type": "integer", "minimum": 1, "maximum": 2000},
"thickness_mm": {"$ref": "#/$defs/positive"},
"axis": {"$ref": "#/$defs/axis"},
"pressure_angle_rad": {"type": "number", "exclusiveMinimum": 0, "maximum": 0.6108652381980153},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["module_mm", "teeth_count", "thickness_mm", "axis"],
"additionalProperties": false
},
"threadAddParams": {
"type": "object",
"properties": {
"major_diameter_mm": {"$ref": "#/$defs/positive"},
"minor_diameter_mm": {"$ref": "#/$defs/positive"},
"pitch_mm": {"$ref": "#/$defs/positive"},
"length_mm": {"$ref": "#/$defs/positive"},
"axis": {"$ref": "#/$defs/axis"},
"angle_deg": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 180},
"lefthand": {"type": "boolean"},
"relief_length_mm": {"type": "number", "minimum": 0},
"crest_radius_mm": {"type": "number", "minimum": 0},
"root_radius_mm": {"type": "number", "minimum": 0},
"result_mode": {"enum": ["fuse", "new_body"]}
},
"required": ["major_diameter_mm", "minor_diameter_mm", "pitch_mm", "length_mm", "axis"],
"additionalProperties": false
},
"threadCutParams": {
"type": "object",
"properties": {
"major_diameter_mm": {"$ref": "#/$defs/positive"},
"minor_diameter_mm": {"$ref": "#/$defs/positive"},
"pitch_mm": {"$ref": "#/$defs/positive"},
"length_mm": {"$ref": "#/$defs/positive"},
"axis": {"$ref": "#/$defs/axis"},
"angle_deg": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 180},
"lefthand": {"type": "boolean"},
"crest_radius_mm": {"type": "number", "minimum": 0},
"root_radius_mm": {"type": "number", "minimum": 0}
},
"required": ["major_diameter_mm", "minor_diameter_mm", "pitch_mm", "length_mm", "axis"],
"additionalProperties": false
},
"holeBaseParams": {
"type": "object",
"properties": {
"diameter_mm": {"$ref": "#/$defs/positive"},
"depth_mm": {"$ref": "#/$defs/positive"},
"positions": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/holePosition"}},
"host_face": {"$ref": "#/$defs/hostFace"},
"drill_angle_rad": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 3.141592653589793}
},
"required": ["diameter_mm", "depth_mm", "positions"]
},
"holeBlindParams": {
"type": "object",
"properties": {
"diameter_mm": {"$ref": "#/$defs/positive"},
"depth_mm": {"$ref": "#/$defs/positive"},
"positions": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/holePosition"}},
"host_face": {"$ref": "#/$defs/hostFace"},
"drill_angle_rad": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 3.141592653589793}
},
"required": ["diameter_mm", "depth_mm", "positions"],
"additionalProperties": false
},
"holeCountersinkParams": {
"allOf": [
{"$ref": "#/$defs/holeBaseParams"},
{
"type": "object",
"properties": {
"diameter_mm": {"$ref": "#/$defs/positive"}, "depth_mm": {"$ref": "#/$defs/positive"},
"positions": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/holePosition"}},
"host_face": {"$ref": "#/$defs/hostFace"}, "drill_angle_rad": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 3.141592653589793},
"countersink_diameter_mm": {"$ref": "#/$defs/positive"},
"countersink_angle_rad": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 3.141592653589793}
},
"required": ["diameter_mm", "depth_mm", "positions", "countersink_diameter_mm", "countersink_angle_rad"],
"additionalProperties": false
}
]
},
"holeCounterboreParams": {
"allOf": [
{"$ref": "#/$defs/holeBaseParams"},
{
"type": "object",
"properties": {
"diameter_mm": {"$ref": "#/$defs/positive"}, "depth_mm": {"$ref": "#/$defs/positive"},
"positions": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/holePosition"}},
"host_face": {"$ref": "#/$defs/hostFace"}, "drill_angle_rad": {"type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 3.141592653589793},
"counterbore_diameter_mm": {"$ref": "#/$defs/positive"},
"counterbore_depth_mm": {"$ref": "#/$defs/positive"}
},
"required": ["diameter_mm", "depth_mm", "positions", "counterbore_diameter_mm", "counterbore_depth_mm"],
"additionalProperties": false
}
]
},
"filletParams": {
"type": "object",
"properties": {"radius_mm": {"type": "number", "minimum": 0}, "tangent_propagation": {"type": "boolean"}},
"required": ["radius_mm"],
"additionalProperties": false
},
"chamferParams": {
"type": "object",
"properties": {"distance_mm": {"type": "number", "minimum": 0}, "distance_2_mm": {"type": "number", "minimum": 0}, "angle_rad": {"type": "number", "minimum": 0, "maximum": 3.141592653589793}, "tangent_propagation": {"type": "boolean"}},
"required": ["distance_mm"],
"additionalProperties": false
},
"shellParams": {
"type": "object",
"properties": {"thickness_mm": {"type": "number", "exclusiveMinimum": 0}, "inward": {"type": "boolean"}, "target_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"required": ["thickness_mm"],
"additionalProperties": false
},
"booleanBodiesParams": {
"type": "object",
"properties": {
"operation": {"enum": ["union", "subtract", "intersect"]},
"target_feature_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"target_pattern_instance_refs": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/patternInstanceBodyRef"}},
"target_transform_copy_refs": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/transformCopyBodyRef"}},
"tool_feature_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"tool_pattern_instance_refs": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/patternInstanceBodyRef"}},
"tool_transform_copy_refs": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/transformCopyBodyRef"}},
"keep_tools": {"type": "boolean"},
"targetless_body_set": {"type": "boolean"}
},
"required": ["operation"],
"allOf": [
{"anyOf": [{"required": ["target_feature_ids"]}, {"required": ["target_pattern_instance_refs"]}, {"required": ["target_transform_copy_refs"]}]},
{"anyOf": [{"required": ["tool_feature_ids"]}, {"required": ["tool_pattern_instance_refs"]}, {"required": ["tool_transform_copy_refs"]}]}
],
"additionalProperties": false
},
"bodyTransform": {
"type": "object",
"properties": {
"type": {"enum": ["translation", "rotation", "uniform_scale"]},
"translation_mm": {"$ref": "#/$defs/point3"},
"axis": {"$ref": "#/$defs/axis"},
"angle_deg": {"type": "number"},
"center_mm": {"$ref": "#/$defs/point3"},
"scale_factor": {"type": "number", "exclusiveMinimum": 0}
},
"required": ["type"],
"allOf": [
{"if": {"properties": {"type": {"const": "translation"}}, "required": ["type"]}, "then": {"required": ["translation_mm"]}},
{"if": {"properties": {"type": {"const": "rotation"}}, "required": ["type"]}, "then": {"required": ["axis", "angle_deg"]}},
{"if": {"properties": {"type": {"const": "uniform_scale"}}, "required": ["type"]}, "then": {"required": ["center_mm", "scale_factor"]}}
],
"additionalProperties": false
},
"patternInstanceBodyRef": {
"type": "object",
"properties": {
"pattern_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"source_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"instance_index": {"type": "integer", "minimum": 1}
},
"required": ["pattern_feature_id", "source_feature_id", "instance_index"],
"additionalProperties": false
},
"transformCopyBodyRef": {
"type": "object",
"properties": {
"transform_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"source_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}
},
"required": ["transform_feature_id", "source_feature_id"],
"additionalProperties": false
},
"transformSourceMemberAlias": {
"type": "object",
"properties": {
"source_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"active_member_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}
},
"required": ["source_feature_id", "active_member_feature_id"],
"additionalProperties": false
},
"transformBodiesParams": {
"type": "object",
"properties": {
"source_feature_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"pattern_instance_refs": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/patternInstanceBodyRef"}},
"transform_copy_refs": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/transformCopyBodyRef"}},
"source_member_aliases": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/$defs/transformSourceMemberAlias"}},
"transform": {"$ref": "#/$defs/bodyTransform"},
"make_copy": {"type": "boolean"}
},
"required": ["transform", "make_copy"],
"anyOf": [{"required": ["source_feature_ids"]}, {"required": ["pattern_instance_refs"]}, {"required": ["transform_copy_refs"]}],
"additionalProperties": false
},
"deleteBodiesParams": {
"type": "object",
"properties": {
"target_feature_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}}
},
"required": ["target_feature_ids"],
"additionalProperties": false
},
"linearPatternParams": {
"type": "object",
"properties": {
"source_feature_ids": {"type": "array", "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"direction_1": {"$ref": "#/$defs/point3"},
"spacing_1_mm": {"type": "number", "minimum": 0},
"pattern_count_1": {"type": "integer", "minimum": 1},
"direction_2": {"$ref": "#/$defs/point3"},
"spacing_2_mm": {"type": "number", "minimum": 0},
"pattern_count_2": {"type": "integer", "minimum": 1}
},
"required": ["source_feature_ids", "direction_1", "spacing_1_mm", "pattern_count_1"],
"additionalProperties": false
},
"mirrorPatternParams": {
"type": "object",
"properties": {
"source_feature_ids": {"type": "array", "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"mirror_plane": {"$ref": "#/$defs/selectorOrUnresolved"},
"mirror_current_body": {"type": "boolean"}
},
"required": ["source_feature_ids", "mirror_plane"],
"additionalProperties": false
},
"circularPatternParams": {
"type": "object",
"properties": {
"source_feature_ids": {"type": "array", "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"axis": {"$ref": "#/$defs/axis"},
"pattern_count": {"type": "integer", "minimum": 1},
"sweep_angle_deg": {"type": "number", "minimum": -360, "maximum": 360},
"operation_mode": {"enum": ["add", "remove"]},
"excluded_instance_indices": {"type": "array", "items": {"type": "integer", "minimum": 1}, "uniqueItems": true}
},
"required": ["source_feature_ids", "axis", "pattern_count"],
"additionalProperties": false
},
"referencePlaneParams": {
"type": "object",
"properties": {
"plane": {"oneOf": [{"$ref": "#/$defs/workplane"}, {"type": "object", "properties": {"unresolved": {"type": "string", "minLength": 1}}, "required": ["unresolved"], "additionalProperties": false}]},
"references": {"type": "array", "items": {"$ref": "#/$defs/selectorRef"}},
"derived_from_sketch_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"derived_from_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"plane_inference": {"enum": ["solidworks_origin_plane_order", "parent_reference_plane"]},
"offset_mm": {"type": "number"},
"angle_rad": {"type": "number"},
"reverse": {"type": "boolean"},
"solidworks_type": {"type": "integer"}
},
"required": ["plane"],
"additionalProperties": false
},
"referenceAxisParams": {
"type": "object",
"properties": {"axis": {"$ref": "#/$defs/axis"}},
"required": ["axis"],
"additionalProperties": false
},
"referencePointParams": {
"type": "object",
"properties": {"point_mm": {"$ref": "#/$defs/point3"}},
"required": ["point_mm"],
"additionalProperties": false
},
"assignVariableParams": {
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1, "maxLength": 256},
"value": {"type": "number"},
"value_kind": {"enum": ["any", "length"]}
},
"required": ["name", "value", "value_kind"],
"additionalProperties": false
},
"holeWizardParams": {
"type": "object",
"properties": {
"hole_type": {"type": "string", "minLength": 1},
"diameter_mm": {"type": "number", "minimum": 0},
"depth_mm": {"type": "number", "minimum": 0},
"end_condition": {"$ref": "#/$defs/endCondition"},
"positions": {"type": "array", "items": {"$ref": "#/$defs/holePosition"}},
"host_face": {"$ref": "#/$defs/hostFace"},
"scope_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"thread": {"type": "object"},
"countersink": {"type": "object"},
"counterbore": {"type": "object"}
},
"required": ["hole_type", "diameter_mm", "depth_mm", "end_condition"],
"additionalProperties": false
},
"featureOutputRole": {
"enum": [
"extrude.start", "extrude.end", "sweep.start", "sweep.end", "loft.start", "loft.end", "cylinder.start", "cylinder.end",
"shell.offset_face", "shell.closing_descendant", "shell.body_face"
]
},
"outputRoleSource": {
"type": "object",
"properties": {
"owner_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_.:-]{1,160}$"},
"output_role": {"$ref": "#/$defs/featureOutputRole"}
},
"required": ["owner_feature_id", "output_role"],
"additionalProperties": false
},
"selectorIntentSourceQuery": {
"type": "object",
"properties": {
"ast": {},
"featurescript_version": {"type": "string", "pattern": "^[0-9]+(?:\\.[0-9]+)*$"},
"standard_library": {"type": "string", "minLength": 1},
"standard_library_version": {"type": "string", "minLength": 1},
"standard_library_imports": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {"type": "string", "minLength": 1},
"version": {"type": "string", "minLength": 1}
},
"required": ["path"],
"additionalProperties": false
}
}
},
"required": ["ast"],
"additionalProperties": false
},
"selectorIntentQueryExprNode": {
"oneOf": [
{
"type": "object",
"properties": {
"node": {"const": "set"},
"operator": {"enum": ["union", "intersection", "subtraction"]},
"operands": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "operator", "operands"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "filter"},
"filter": {"enum": ["adjacent", "owner_body", "body_type", "construction"]},
"input": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "filter", "input", "arguments"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "topology_query"},
"owner": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"topology_type": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"entity_type": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "owner", "topology_type", "entity_type", "arguments"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "created_by"},
"owner": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "owner", "arguments"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "source_entity"},
"sketch": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"entity_type": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"entity": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "sketch", "entity_type", "entity", "arguments"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "sketch_region"},
"sketch": {"$ref": "#/$defs/selectorIntentQueryExprNode"},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "sketch", "arguments"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "opaque_call"},
"name": {"type": "string", "minLength": 1},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "name", "arguments"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "list"},
"items": {"type": "array", "items": {"$ref": "#/$defs/selectorIntentQueryExprNode"}}
},
"required": ["node", "items"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "map"},
"entries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {"type": "string"},
"value": {"$ref": "#/$defs/selectorIntentQueryExprNode"}
},
"required": ["key", "value"],
"additionalProperties": false
}
}
},
"required": ["node", "entries"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"node": {"const": "literal"},
"value": {}
},
"required": ["node", "value"],
"additionalProperties": false
}
]
},
"selectorIntentQueryExpr": {
"type": "object",
"properties": {
"version": {"const": "1.0"},
"root": {"$ref": "#/$defs/selectorIntentQueryExprNode"}
},
"required": ["version", "root"],
"additionalProperties": false
},
"selectorIntent": {
"type": "object",
"properties": {
"version": {"const": "1.0"},
"kind": {"enum": ["face", "edge", "axis", "plane", "feature", "vertex", "body"]},
"query_family": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,79}$"},
"source_query": {"$ref": "#/$defs/selectorIntentSourceQuery"},
"query_expr": {"$ref": "#/$defs/selectorIntentQueryExpr"},
"source_entity": {
"type": "object",
"properties": {
"sketch_id": {"type": "string", "minLength": 1},
"entity_id": {"type": "string", "minLength": 1}
},
"required": ["sketch_id", "entity_id"],
"additionalProperties": false
},
"source_entities": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"sketch_id": {"type": "string", "minLength": 1},
"entity_id": {"type": "string", "minLength": 1}
},
"required": ["sketch_id", "entity_id"],
"additionalProperties": false
}
},
"intersection_sources": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"items": {
"type": "object",
"properties": {
"query_family": {"enum": ["CAP_FACE", "SWEPT_FACE"]},
"owner_feature_id": {"type": "string", "minLength": 1, "maxLength": 160},
"output_role": {"enum": ["extrude.start", "extrude.end"]},
"source_entity": {
"type": "object",
"properties": {
"sketch_id": {"type": "string", "minLength": 1},
"entity_id": {"type": "string", "minLength": 1}
},
"required": ["sketch_id", "entity_id"],
"additionalProperties": false
}
},
"required": ["query_family", "owner_feature_id"],
"additionalProperties": false
}
},
"blend_sources": {
"type": "object",
"properties": {
"edge": {
"type": "object",
"properties": {
"query_family": {"const": "CAP_EDGE"},
"owner_feature_id": {"type": "string", "minLength": 1, "maxLength": 160},
"source_entity": {
"type": "object",
"properties": {
"sketch_id": {"type": "string", "minLength": 1},
"entity_id": {"type": "string", "minLength": 1}
},
"required": ["sketch_id", "entity_id"],
"additionalProperties": false
},
"lineage_role": {"enum": ["extrude.start", "extrude.end"]}
},
"required": ["query_family", "owner_feature_id", "source_entity", "lineage_role"],
"additionalProperties": false
},
"face": {
"type": "object",
"properties": {
"query_family": {"enum": ["CAP_FACE", "SWEPT_FACE"]},
"owner_feature_id": {"type": "string", "minLength": 1, "maxLength": 160},
"output_role": {"enum": ["extrude.start", "extrude.end"]},
"source_entity": {
"type": "object",
"properties": {
"sketch_id": {"type": "string", "minLength": 1},
"entity_id": {"type": "string", "minLength": 1}
},
"required": ["sketch_id", "entity_id"],
"additionalProperties": false
}
},
"required": ["query_family", "owner_feature_id"],
"additionalProperties": false
}
},
"required": ["edge", "face"],
"additionalProperties": false
},
"blend_face_source": {
"type": "object",
"properties": {
"query_family": {"const": "CAP_EDGE"},
"owner_feature_id": {"type": "string", "minLength": 1, "maxLength": 160},
"source_entity": {
"type": "object",
"properties": {
"sketch_id": {"type": "string", "minLength": 1},
"entity_id": {"type": "string", "minLength": 1}
},
"required": ["sketch_id", "entity_id"],
"additionalProperties": false
},
"lineage_role": {"enum": ["extrude.start", "extrude.end"]}
},
"required": ["query_family", "owner_feature_id", "source_entity", "lineage_role"],
"additionalProperties": false
},
"output_role": {"$ref": "#/$defs/featureOutputRole"},
"consumer_contract": {"enum": ["direct_prism_cap_face_workplane", "primary_add_shell_union_continuation", "primary_add_up_to_surface_union_continuation", "primary_add_dressup_union_continuation", "symmetric_direct_prism_two_sided_up_to_surface_cap_pair", "symmetric_direct_prism_shell_swept_face_up_to_surface_pair", "immediate_retained_source_prism_swept_face_up_to_surface", "shell_retained_direct_prism_cap_offset_face_profile", "direct_prism_shell_offset_edge_tdd", "direct_prism_shell_offset_edge_vertex"]},
"lineage_role": {"enum": ["extrude.start", "extrude.end"]},
"body_member_contract": {"enum": ["direct_new_body"]},
"query_set_contract": {"enum": ["proven_operand_union", "proven_operand_intersection", "proven_operand_subtraction"]},
"owner_body_contract": {"enum": ["exact_input_owner"]},
"copy_contract": {"enum": ["primary_cut_cap_edge", "primary_cut_cap_face_workplane", "primary_cut_swept_face_workplane"]},
"set_kind": {"enum": ["face", "edge"]},
"body_scope": {"enum": ["active_member"]},
"empty_policy": {"enum": ["reject"]},
"multiple_policy": {"enum": ["all", "one"]},
"derivation_policy": {
"type": "object",
"properties": {
"allowed": {"type": "array", "minItems": 1, "items": {"enum": ["continuation", "fragment", "merge", "intersection", "boundary", "replacement"]}},
"multiplicity": {"enum": ["one", "all_fragments", "source_qualified", "none"]}
},
"required": ["allowed", "multiplicity"],
"additionalProperties": false
},
"evidence": {"enum": ["kernel_history", "operation_role", "active_body_member", "feature_script_query", "explicit_datum", "geometry_hint"]},
"disambiguation": {"type": "object"}
},
"required": ["version", "query_family", "source_query", "derivation_policy", "evidence"],
"additionalProperties": false
},
"selectorRef": {
"type": "object",
"properties": {
"kind": {"enum": ["face", "edge", "axis", "plane", "feature", "vertex", "body"]},
"stable_id": {"type": "string", "minLength": 1},
"output_role": {"$ref": "#/$defs/featureOutputRole"},
"output_role_source": {"$ref": "#/$defs/outputRoleSource"},
"owner_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_.:-]{1,160}$"},
"owner_match_required": {"type": "boolean"},
"geometry": {"type": "object"},
"source": {"enum": ["solidworks", "inferred_from_step", "runtime_snapshot", "viewer_selection"]},
"snapshot_id": {"type": "string", "minLength": 1},
"binding_feature_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"match_mode": {"enum": ["unique", "all"]},
"query_input": {"$ref": "#/$defs/selectorRef"},
"query_operands": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/selectorRef"}},
"matched_selectors": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/selectorRef"}},
"intersection_of": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/selectorRef"}},
"selector_intent_version": {"const": "1.0"},
"selector_intent": {"$ref": "#/$defs/selectorIntent"},
"confidence": {"type": "number", "minimum": 0, "maximum": 1}
},
"required": ["kind", "source", "confidence"],
"anyOf": [{"required": ["stable_id"]}, {"required": ["output_role"]}, {"required": ["selector_intent"]}],
"additionalProperties": false
},
"analyticSegment": {
"type": "object",
"properties": {
"type": {"enum": ["line", "arc", "circle", "ellipse", "bspline"]},
"start": {"$ref": "#/$defs/point2"},
"end": {"$ref": "#/$defs/point2"},
"center": {"$ref": "#/$defs/point2"},
"radius_mm": {"$ref": "#/$defs/positive"},
"major_radius_mm": {"$ref": "#/$defs/positive"},
"minor_radius_mm": {"$ref": "#/$defs/positive"},
"major_axis": {"$ref": "#/$defs/point2"},
"points": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/point2"}},
"parameters": {"type": "array", "minItems": 2, "items": {"type": "number"}},
"periodic": {"type": "boolean"},
"parameterization": {"enum": ["chord", "centripetal"]},
"clockwise": {"type": "boolean"},
"start_tangent": {"$ref": "#/$defs/point2"},
"end_tangent": {"$ref": "#/$defs/point2"}
,"source_entity_id": {"type": "string", "minLength": 1, "maxLength": 160}
},
"required": ["type"],
"allOf": [
{"if": {"properties": {"type": {"const": "line"}}}, "then": {"required": ["start", "end"]}},
{"if": {"properties": {"type": {"const": "arc"}}}, "then": {"required": ["start", "end", "center", "radius_mm"]}},
{"if": {"properties": {"type": {"const": "circle"}}}, "then": {"required": ["center", "radius_mm"]}},
{"if": {"properties": {"type": {"const": "ellipse"}}}, "then": {"required": ["center", "major_radius_mm", "minor_radius_mm", "major_axis"]}},
{"if": {"properties": {"type": {"const": "bspline"}}}, "then": {"required": ["start", "end", "points"]}},
{"if": {"properties": {"type": {"const": "bspline"}, "points": {"maxItems": 2}}}, "then": {"required": ["start_tangent", "end_tangent", "parameters"], "properties": {"periodic": {"const": false}}}}
],
"additionalProperties": false
},
"spatialSweepSegment": {
"type": "object",
"properties": {
"type": {"enum": ["line", "arc", "bspline"]},
"start_mm": {"$ref": "#/$defs/point3"},
"end_mm": {"$ref": "#/$defs/point3"},
"center_mm": {"$ref": "#/$defs/point3"},
"normal": {"$ref": "#/$defs/point3"},
"radius_mm": {"$ref": "#/$defs/positive"},
"points_mm": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/point3"}},
"parameters": {"type": "array", "minItems": 2, "items": {"type": "number"}},
"periodic": {"type": "boolean"},
"clockwise": {"type": "boolean"},
"start_tangent_mm": {"$ref": "#/$defs/point3"},
"end_tangent_mm": {"$ref": "#/$defs/point3"},
"source_sketch_id": {"type": "string", "minLength": 1, "maxLength": 160},
"source_entity_id": {"type": "string", "minLength": 1, "maxLength": 160}
},
"required": ["type", "source_sketch_id", "source_entity_id"],
"allOf": [
{"if": {"properties": {"type": {"const": "line"}}}, "then": {"required": ["start_mm", "end_mm"]}},
{"if": {"properties": {"type": {"const": "arc"}}}, "then": {"required": ["start_mm", "end_mm", "center_mm", "normal", "radius_mm"]}},
{"if": {"properties": {"type": {"const": "bspline"}}}, "then": {"required": ["points_mm"]}},
{"if": {"properties": {"type": {"const": "bspline"}, "points_mm": {"maxItems": 2}}}, "then": {"required": ["start_tangent_mm", "end_tangent_mm", "parameters"], "properties": {"periodic": {"const": false}}}}
],
"additionalProperties": false
},
"constructionBsplineSegment": {
"type": "object",
"properties": {
"type": {"const": "bspline"},
"degree": {"type": "integer", "minimum": 1},
"control_points": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/point2"}},
"knots": {"type": "array", "minItems": 2, "items": {"type": "number"}},
"periodic": {"type": "boolean"},
"weights": {"type": "array", "minItems": 2, "items": {"type": "number", "exclusiveMinimum": 0}}
},
"required": ["type", "degree", "control_points", "knots", "periodic"],
"additionalProperties": false
},
"constructionSegment": {
"oneOf": [
{"$ref": "#/$defs/analyticSegment"},
{"$ref": "#/$defs/constructionBsplineSegment"}
]
},
"analyticContour": {
"type": "object",
"properties": {
"role": {"enum": ["outer", "inner", "open", "unknown"]},
"closed": {"type": "boolean"},
"surface_wire": {"type": "boolean"},
"segments": {"type": "array", "items": {"$ref": "#/$defs/analyticSegment"}}
},
"required": ["role", "closed", "segments"],
"additionalProperties": false
},
"analyticProfile": {
"type": "object",
"properties": {
"type": {"const": "analytic_contours"},
"contours": {"type": "array", "items": {"$ref": "#/$defs/analyticContour"}},
"construction": {"type": "array", "items": {"$ref": "#/$defs/constructionSegment"}}
},
"required": ["type", "contours"],
"additionalProperties": false
},
"imprintSourceEntity": {
"type": "object",
"properties": {
"id": {"type": "string", "minLength": 1, "maxLength": 160},
"curve": {"$ref": "#/$defs/analyticSegment"}
},
"required": ["id", "curve"],
"additionalProperties": false
},
"imprintFragment": {
"type": "object",
"properties": {
"anchor_entity_id": {"type": "string", "minLength": 1, "maxLength": 160},
"external_anchor_id": {"type": "string", "minLength": 1, "maxLength": 160},
"side": {"enum": [-1, 1]},
"intersection_index": {"type": "integer", "minimum": 0}
},
"required": ["side"],
"oneOf": [
{"required": ["anchor_entity_id"]},
{"required": ["external_anchor_id"]}
],
"additionalProperties": false
},
"imprintExternalAnchor": {
"type": "object",
"properties": {
"id": {"type": "string", "minLength": 1, "maxLength": 160},
"selector": {"$ref": "#/$defs/selectorRef"}
},
"required": ["id", "selector"],
"additionalProperties": false
},
"imprintSelection": {
"type": "object",
"properties": {
"source_entity_id": {"type": "string", "minLength": 1, "maxLength": 160},
"face_side": {"enum": [-1, 1]},
"fragment": {"$ref": "#/$defs/imprintFragment"}
},
"required": ["source_entity_id", "face_side"],
"additionalProperties": false
},
"planarImprintProfile": {
"type": "object",
"properties": {
"type": {"const": "planar_imprint"},
"source_entities": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/imprintSourceEntity"}},
"selections": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/imprintSelection"}},
"external_anchors": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/imprintExternalAnchor"}}
},
"required": ["type", "source_entities", "selections"],
"allOf": [
{
"if": {"not": {"required": ["external_anchors"]}},
"then": {"properties": {"source_entities": {"minItems": 2}}}
}
],
"additionalProperties": false
},
"multiSourceRegionsProfile": {
"type": "object",
"properties": {
"type": {"const": "multi_source_regions"},
"source_sketch_ids": {"type": "array", "minItems": 2, "items": {"type": "string", "minLength": 1, "maxLength": 160}, "uniqueItems": true},
"profiles": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/directProfile"}}
},
"required": ["type", "source_sketch_ids", "profiles"],
"additionalProperties": false
},
"directProfile": {
"oneOf": [
{"type": "object", "properties": {"type": {"const": "circle"}, "center": {"$ref": "#/$defs/point2"}, "radius_mm": {"$ref": "#/$defs/positive"}, "source_entity_id": {"type": "string", "minLength": 1, "maxLength": 160}}, "required": ["type", "radius_mm"], "additionalProperties": false},
{"type": "object", "properties": {"type": {"const": "polygon"}, "vertices": {"type": "array", "minItems": 3, "items": {"$ref": "#/$defs/point2"}}}, "required": ["type", "vertices"], "additionalProperties": false},
{"$ref": "#/$defs/analyticProfile"}
]
},
"feature_atomic_ids": {"enum": ["extrude_add_blind", "extrude_add_blind_with_hole", "extrude_add_two_sided", "extrude_cut_blind", "extrude_cut_two_sided", "extrude_cut_through", "extrude_from_face", "extrude_surface", "loft_add", "loft_add_with_cap_face", "loft_surface", "sweep_add", "sweep_cut", "revolve_add", "revolve_cut", "revolve_surface", "hole_blind", "hole_countersink", "hole_counterbore", "sphere_add", "box_add", "cylinder_add", "thread_add", "thread_cut", "bend_add", "gear_add", "rack_add", "fillet", "chamfer", "shell", "boolean_bodies", "transform_bodies", "delete_bodies", "pattern_linear", "pattern_mirror", "pattern_circular", "reference_plane", "reference_axis", "reference_point", "assign_variable", "hole_wizard"]},
"feature": {
"type": "object",
"properties": {
"id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"name": {"type": "string"},
"atomic_id": {"$ref": "#/$defs/feature_atomic_ids"},
"depends_on": {"type": "array", "items": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"sketch_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"},
"params": {"type": "object"},
"execution_status": {"enum": ["supported", "deferred"]},
"selectors": {"type": "array", "items": {"$ref": "#/$defs/selectorRef"}},
"unresolved": {"type": "array", "items": {"type": "string", "minLength": 1}},
"intent": {"$ref": "#/$defs/featureIntent"}
},
"required": ["id", "atomic_id", "depends_on", "params"],
"additionalProperties": false,
"allOf": [
{"if": {"properties": {"atomic_id": {"const": "extrude_add_blind"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_add_blind_with_hole"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_add_two_sided"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_cut_blind"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_cut_through"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeCutThroughParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_cut_two_sided"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_from_face"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeFromFaceParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "loft_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/loftParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "loft_add_with_cap_face"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/loftCapFaceParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "loft_surface"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/loftParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "sweep_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/sweepParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "sweep_cut"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/sweepParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "revolve_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/revolveParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "revolve_cut"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/revolveParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "revolve_surface"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/revolveSurfaceParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "extrude_surface"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/extrudeSurfaceParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "sphere_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/sphereParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "box_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/boxParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "cylinder_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/cylinderParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "bend_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/bendAddParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "gear_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/gearAddParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "rack_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/rackAddParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "thread_add"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/threadAddParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "thread_cut"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/threadCutParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "hole_blind"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/holeBlindParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "hole_countersink"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/holeCountersinkParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "hole_counterbore"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/holeCounterboreParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "fillet"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/filletParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "chamfer"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/chamferParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "shell"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/shellParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "boolean_bodies"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/booleanBodiesParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "transform_bodies"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/transformBodiesParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "delete_bodies"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/deleteBodiesParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "pattern_linear"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/linearPatternParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "pattern_mirror"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/mirrorPatternParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "pattern_circular"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/circularPatternParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "reference_plane"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/referencePlaneParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "reference_axis"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/referenceAxisParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "reference_point"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/referencePointParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "assign_variable"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/assignVariableParams"}}}},
{"if": {"properties": {"atomic_id": {"const": "hole_wizard"}}}, "then": {"properties": {"params": {"$ref": "#/$defs/holeWizardParams"}}}}
]
},
"profile_type": {"enum": ["circle", "polygon", "analytic_contours", "multi_source_regions", "planar_imprint"]},
"profile": {
"oneOf": [
{"type": "object", "properties": {"type": {"const": "circle"}, "center": {"$ref": "#/$defs/point2"}, "radius_mm": {"$ref": "#/$defs/positive"}, "source_entity_id": {"type": "string", "minLength": 1, "maxLength": 160}}, "required": ["type", "radius_mm"], "additionalProperties": false},
{"type": "object", "properties": {"type": {"const": "polygon"}, "vertices": {"type": "array", "minItems": 3, "items": {"$ref": "#/$defs/point2"}}}, "required": ["type", "vertices"], "additionalProperties": false},
{"$ref": "#/$defs/analyticProfile"},
{"$ref": "#/$defs/multiSourceRegionsProfile"},
{"$ref": "#/$defs/planarImprintProfile"}
]
},
"sketch": {
"type": "object",
"properties": {"id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}, "name": {"type": "string"}, "source_sketch_id": {"type": "string", "minLength": 1, "maxLength": 160}, "workplane": {"$ref": "#/$defs/workplane"}, "profile": {"$ref": "#/$defs/profile"}, "role": {"enum": ["profile", "reference"]}, "attachment": {"$ref": "#/$defs/selectorRef"}, "profile_from": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,80}$"}},
"required": ["id", "workplane", "profile"],
"additionalProperties": false
}
}
}