335 lines
9.9 KiB
JSON
335 lines
9.9 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://cadset.local/contracts/designir-3.0.schema.json",
|
|
"title": "DesignIR 3.0",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"schema_version",
|
|
"designir_kind",
|
|
"model_id",
|
|
"units",
|
|
"document_status",
|
|
"reconstruction_mode",
|
|
"semantic_layer",
|
|
"edit_interface",
|
|
"validation_contract"
|
|
],
|
|
"properties": {
|
|
"schema_version": {"const": "3.0"},
|
|
"designir_kind": {"const": "independent_parametric_cad"},
|
|
"model_id": {"type": "string", "minLength": 1},
|
|
"family": {"type": "string", "minLength": 1},
|
|
"units": {"const": "mm"},
|
|
"authoring_mode": {
|
|
"enum": ["semantic_feature_program", "final_brep_inference"]
|
|
},
|
|
"backend_hint": {"enum": ["build123d", "simplecadapi", "auto"]},
|
|
"document_status": {"enum": ["geometry_present", "empty_geometry"]},
|
|
"reconstruction_mode": {
|
|
"enum": [
|
|
"fully_semantic_parametric",
|
|
"hybrid_semantic_surface_parametric",
|
|
"surface_parametric"
|
|
]
|
|
},
|
|
"semantic_layer": {
|
|
"type": "object",
|
|
"required": ["parameters", "datums", "features", "constraints"],
|
|
"properties": {
|
|
"reconstruction_status": {
|
|
"enum": ["ready", "partial", "unsupported_feature_vocabulary"]
|
|
},
|
|
"coordinate_system": {"$ref": "#/$defs/coordinateSystem"},
|
|
"parameters": {"type": "object"},
|
|
"datums": {"type": "object"},
|
|
"expressions": {"type": "object"},
|
|
"sketches": {"type": "array", "items": {"type": "object"}},
|
|
"features": {"type": "array", "items": {"type": "object"}},
|
|
"constraints": {"type": "array", "items": {"type": "object"}},
|
|
"patterns": {"type": "array", "items": {"type": "object"}},
|
|
"attachments": {"type": "array", "items": {"type": "object"}},
|
|
"construction_stages": {"type": "array", "items": {"type": "object"}},
|
|
"missing_capabilities": {"type": "array", "items": {"type": "string"}},
|
|
"applied_experience_ids": {"type": "array", "items": {"type": "string"}}
|
|
}
|
|
},
|
|
"surface_layer": {
|
|
"type": "object",
|
|
"required": ["vertices", "solids", "free_shells", "surface_vocabulary", "curve_vocabulary"],
|
|
"properties": {
|
|
"vertices": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "point", "tolerance"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"point": {"$ref": "#/$defs/point3"},
|
|
"tolerance": {"type": "number", "minimum": 0}
|
|
}
|
|
}
|
|
},
|
|
"solids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "shells"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"shells": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "faces"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"faces": {
|
|
"type": "array",
|
|
"items": {"$ref": "#/$defs/face"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"free_shells": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "faces"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"orientation": {"type": "integer"},
|
|
"faces": {
|
|
"type": "array",
|
|
"items": {"$ref": "#/$defs/face"}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"surface_vocabulary": {
|
|
"type": "array",
|
|
"items": {
|
|
"enum": ["plane", "cylinder", "cone", "sphere", "torus", "bspline"]
|
|
},
|
|
"uniqueItems": true
|
|
},
|
|
"curve_vocabulary": {
|
|
"type": "array",
|
|
"items": {
|
|
"enum": ["line", "circle", "ellipse", "bspline", "degenerate"]
|
|
},
|
|
"uniqueItems": true
|
|
}
|
|
}
|
|
},
|
|
"reconstruction_strategy": {
|
|
"type": "object",
|
|
"required": ["boundary_strategy", "selection_status"],
|
|
"properties": {
|
|
"boundary_strategy": {
|
|
"enum": [
|
|
"exact_3d",
|
|
"exact_3d_pcurve",
|
|
"first_pcurve",
|
|
"analytic_uv_rect",
|
|
"uv_rect_all"
|
|
]
|
|
},
|
|
"selection_status": {
|
|
"enum": ["default", "geometry_validated", "unresolved"]
|
|
}
|
|
}
|
|
},
|
|
"edit_interface": {
|
|
"type": "object",
|
|
"required": [
|
|
"semantic_parameters",
|
|
"surface_parameter_groups",
|
|
"modification_levels"
|
|
],
|
|
"properties": {
|
|
"semantic_parameters": {
|
|
"type": "array",
|
|
"items": {"type": "string"},
|
|
"uniqueItems": true
|
|
},
|
|
"surface_parameter_groups": {
|
|
"type": "array",
|
|
"items": {"type": "string"},
|
|
"uniqueItems": true
|
|
},
|
|
"modification_levels": {
|
|
"type": "array",
|
|
"items": {
|
|
"enum": ["semantic_feature", "analytic_surface", "spline_control"]
|
|
},
|
|
"uniqueItems": true
|
|
},
|
|
"preserved_interfaces": {"type": "array", "items": {"type": "string"}}
|
|
}
|
|
},
|
|
"validation_contract": {
|
|
"type": "object",
|
|
"required": ["source_independence", "geometry_checks", "edit_checks"],
|
|
"properties": {
|
|
"source_independence": {"const": true},
|
|
"geometry_checks": {"type": "array", "items": {"type": "string"}},
|
|
"edit_checks": {"type": "array", "items": {"type": "string"}},
|
|
"invariants": {"type": "array", "items": {"type": "object"}},
|
|
"perturbations": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["parameter", "scale", "expected_change"],
|
|
"properties": {
|
|
"parameter": {"type": "string"},
|
|
"scale": {"type": "number", "exclusiveMinimum": 0},
|
|
"expected_change": {"type": "string", "minLength": 1},
|
|
"preserve": {"type": "array", "items": {"type": "string"}}
|
|
}
|
|
}
|
|
},
|
|
"thresholds": {"type": "object"}
|
|
}
|
|
},
|
|
"compiled_surface_provenance": {
|
|
"type": "object",
|
|
"required": [
|
|
"source",
|
|
"teacher_geometry_used",
|
|
"semantic_layer_authoritative"
|
|
],
|
|
"properties": {
|
|
"source": {"const": "generated_step"},
|
|
"teacher_geometry_used": {"const": false},
|
|
"semantic_layer_authoritative": {"const": true}
|
|
}
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {"reconstruction_mode": {"const": "surface_parametric"}}
|
|
},
|
|
"then": {"required": ["surface_layer"]}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"reconstruction_mode": {
|
|
"enum": [
|
|
"fully_semantic_parametric",
|
|
"hybrid_semantic_surface_parametric"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"required": ["family", "authoring_mode"],
|
|
"properties": {
|
|
"semantic_layer": {
|
|
"required": [
|
|
"reconstruction_status",
|
|
"coordinate_system",
|
|
"parameters",
|
|
"datums",
|
|
"expressions",
|
|
"sketches",
|
|
"features",
|
|
"constraints",
|
|
"patterns",
|
|
"attachments",
|
|
"construction_stages"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"reconstruction_mode": {
|
|
"const": "hybrid_semantic_surface_parametric"
|
|
}
|
|
}
|
|
},
|
|
"then": {"required": ["surface_layer", "compiled_surface_provenance"]}
|
|
}
|
|
],
|
|
"$defs": {
|
|
"point3": {
|
|
"type": "array",
|
|
"prefixItems": [
|
|
{"type": "number"},
|
|
{"type": "number"},
|
|
{"type": "number"}
|
|
],
|
|
"minItems": 3,
|
|
"maxItems": 3
|
|
},
|
|
"coordinateSystem": {
|
|
"type": "object",
|
|
"required": ["origin", "x_axis", "y_axis", "z_axis"],
|
|
"properties": {
|
|
"origin": {"$ref": "#/$defs/point3"},
|
|
"x_axis": {"$ref": "#/$defs/point3"},
|
|
"y_axis": {"$ref": "#/$defs/point3"},
|
|
"z_axis": {"$ref": "#/$defs/point3"}
|
|
}
|
|
},
|
|
"face": {
|
|
"type": "object",
|
|
"required": ["id", "orientation", "surface", "uv_bounds", "wires"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"orientation": {"type": "integer"},
|
|
"surface": {"type": "object"},
|
|
"uv_bounds": {
|
|
"type": "array",
|
|
"items": {"type": "number"},
|
|
"minItems": 4,
|
|
"maxItems": 4
|
|
},
|
|
"wires": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "orientation", "edges"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"orientation": {"type": "integer"},
|
|
"edges": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"topology_edge_id",
|
|
"vertex_ids",
|
|
"orientation",
|
|
"curve"
|
|
],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"topology_edge_id": {"type": "string"},
|
|
"vertex_ids": {
|
|
"type": "array",
|
|
"items": {"type": "string"},
|
|
"maxItems": 2
|
|
},
|
|
"orientation": {"type": "integer"},
|
|
"curve": {"type": "object"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|