feat: unify CAD workflows on DesignIR 3.0
This commit is contained in:
@@ -33,6 +33,11 @@
|
||||
"backend_hint": {
|
||||
"enum": ["auto", "build123d", "simplecadapi"]
|
||||
},
|
||||
"applied_experience_ids": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"reconstruction_status": {
|
||||
"enum": ["ready", "partial", "unsupported_feature_vocabulary"]
|
||||
},
|
||||
@@ -177,6 +182,12 @@
|
||||
"minItems": 3,
|
||||
"maxItems": 3
|
||||
},
|
||||
"valueVector3": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/$defs/value"},
|
||||
"minItems": 3,
|
||||
"maxItems": 3
|
||||
},
|
||||
"parameter": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
@@ -186,6 +197,28 @@
|
||||
"unit": {"enum": ["mm", "deg", "count", "ratio"]},
|
||||
"editable": {"type": "boolean"},
|
||||
"role": {"type": "string"},
|
||||
"semantic_aliases": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"inference": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["status", "confidence"],
|
||||
"properties": {
|
||||
"status": {
|
||||
"enum": ["user_specified", "inferred_from_final_brep", "validated"]
|
||||
},
|
||||
"confidence": {"type": "number", "minimum": 0, "maximum": 1},
|
||||
"evidence_kind": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"affects_feature_ids": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"minimum": {"type": "number"},
|
||||
"maximum": {"type": "number"}
|
||||
}
|
||||
@@ -228,8 +261,17 @@
|
||||
"depth": {"$ref": "#/$defs/value"},
|
||||
"count": {"$ref": "#/$defs/value"},
|
||||
"pitch_diameter": {"$ref": "#/$defs/value"},
|
||||
"axis": {"type": "string"},
|
||||
"center": {"$ref": "#/$defs/vector3"},
|
||||
"axis": {
|
||||
"oneOf": [
|
||||
{"type": "string"},
|
||||
{"$ref": "#/$defs/vector3"}
|
||||
]
|
||||
},
|
||||
"center": {"$ref": "#/$defs/valueVector3"},
|
||||
"anchor": {
|
||||
"enum": ["base_center", "geometric_center"],
|
||||
"default": "base_center"
|
||||
},
|
||||
"host": {"type": "string"}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
{
|
||||
"$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"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user