216a7ed625
Port the runtime-tracer half of PR #30 (feat/cadquery_converter) and rewrite its emission layer to the current Feature Tree Convention, following the tools/research/histjson four-stage pattern (trace / translate / validate / profile + responsibility wall: the translator only translates). - tracer/ (instrument, fingerprint, cq_runner, worker) ported near-verbatim: runs under .venv-cq (Python 3.11 + cadquery 2.8); records resolved plane frames, serialized args, selector strings, and geometric fingerprints of actually-selected faces/edges plus ground-truth volume/bbox per program. - emission rewritten for FTC: block headers with closed role vocabulary and no positional slugs; transcribed planar profiles authored through the sketch API (local coords, pooled points, three-point arcs via circumcenter) annotated profile=geometry; booleans in list form over a histjson-shaped bodies dataflow; fillet/chamfer/shell selections synthesized as QL predicate bands from trace fingerprints with take/exactly cardinality; through-cut depths derived from the trace bbox; zero in-source verification; literal numbers only. - unknown ops become untranslated notes, never silent drops; static-AST path and exploratory scoring/edit-bench from the PR intentionally not ported. - directory named cadqueryftc so it can never shadow `import cadquery`. - fixtures are real traces captured with cadquery 2.8; 13 tests pin format contracts + volume reconciliation (all four reconcile at <=2.2e-12 rel err) with no cadquery required in CI; full test/ suite 1516 passed.
654 lines
11 KiB
JSON
654 lines
11 KiB
JSON
{
|
|
"cq_status": "ok",
|
|
"error": "",
|
|
"cq_volume": 11087.955961135734,
|
|
"cq_bbox": [
|
|
-32.4,
|
|
-5.0,
|
|
-32.4,
|
|
32.4,
|
|
1.6781084181954496e-17,
|
|
32.4
|
|
],
|
|
"steps": [
|
|
{
|
|
"op": "Workplane",
|
|
"args": [
|
|
"XZ"
|
|
],
|
|
"plane_name": "XZ",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
-1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "circle",
|
|
"args": [
|
|
32.4
|
|
],
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
-1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "extrude",
|
|
"args": [
|
|
5.0
|
|
],
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
-1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": true
|
|
},
|
|
{
|
|
"op": "faces",
|
|
"args": [
|
|
">Y"
|
|
],
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
-1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"selector": ">Y",
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"selector": ">Y",
|
|
"selections": [
|
|
{
|
|
"kind": "face",
|
|
"index": 1,
|
|
"geom_type": "PLANE",
|
|
"center": [
|
|
1.4210854715202004e-14,
|
|
0.0,
|
|
-8.663834607652495e-16
|
|
],
|
|
"normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"area": 3297.918304032421,
|
|
"bbox": {
|
|
"min": [
|
|
-32.4,
|
|
0.0,
|
|
-32.4
|
|
],
|
|
"max": [
|
|
32.4,
|
|
0.0,
|
|
32.4
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
-1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"selections": [
|
|
{
|
|
"kind": "face",
|
|
"index": 1,
|
|
"geom_type": "PLANE",
|
|
"center": [
|
|
1.4210854715202004e-14,
|
|
0.0,
|
|
-8.663834607652495e-16
|
|
],
|
|
"normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"area": 3297.918304032421,
|
|
"bbox": {
|
|
"min": [
|
|
-32.4,
|
|
0.0,
|
|
-32.4
|
|
],
|
|
"max": [
|
|
32.4,
|
|
0.0,
|
|
32.4
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"args": [
|
|
"Plane(origin=(0.0, 0.0, 0.0), xDir=(-1.0, -0.0, 0.0), normal=(-0.0, 1.0, 0.0))"
|
|
],
|
|
"plane_name": "Plane(origin=(0.0, 0.0, 0.0), xDir=(-1.0, -0.0, 0.0), normal=(-0.0, 1.0, 0.0))",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
-1.0,
|
|
-0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "hole",
|
|
"args": [
|
|
37.0
|
|
],
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
-1.0,
|
|
-0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": true
|
|
},
|
|
{
|
|
"op": "edges",
|
|
"args": [
|
|
">Y"
|
|
],
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
-1.0,
|
|
-0.0,
|
|
0.0
|
|
],
|
|
"selector": ">Y",
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"selector": ">Y",
|
|
"selections": [
|
|
{
|
|
"kind": "edge",
|
|
"index": 1,
|
|
"geom_type": "CIRCLE",
|
|
"center": [
|
|
1.5209269266911748e-13,
|
|
0.0,
|
|
-8.670602095899002e-16
|
|
],
|
|
"length": 203.57520395261858,
|
|
"bbox": {
|
|
"min": [
|
|
-32.4,
|
|
0.0,
|
|
-32.4
|
|
],
|
|
"max": [
|
|
32.4,
|
|
0.0,
|
|
32.4
|
|
]
|
|
},
|
|
"start": [
|
|
32.4,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"end": [
|
|
32.4,
|
|
0.0,
|
|
0.0
|
|
]
|
|
},
|
|
{
|
|
"kind": "edge",
|
|
"index": 3,
|
|
"geom_type": "CIRCLE",
|
|
"center": [
|
|
8.820713588690454e-14,
|
|
0.0,
|
|
5.492201376236126e-16
|
|
],
|
|
"length": 116.23892818282235,
|
|
"bbox": {
|
|
"min": [
|
|
-18.5,
|
|
0.0,
|
|
-18.5
|
|
],
|
|
"max": [
|
|
18.5,
|
|
0.0,
|
|
18.5
|
|
]
|
|
},
|
|
"start": [
|
|
18.5,
|
|
0.0,
|
|
-4.531193156845207e-15
|
|
],
|
|
"end": [
|
|
18.5,
|
|
0.0,
|
|
-4.531193156845207e-15
|
|
]
|
|
}
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "chamfer",
|
|
"args": [
|
|
0.4
|
|
],
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
-1.0,
|
|
-0.0,
|
|
0.0
|
|
],
|
|
"selections": [
|
|
{
|
|
"kind": "edge",
|
|
"index": 1,
|
|
"geom_type": "CIRCLE",
|
|
"center": [
|
|
1.5209269266911748e-13,
|
|
0.0,
|
|
-8.670602095899002e-16
|
|
],
|
|
"length": 203.57520395261858,
|
|
"bbox": {
|
|
"min": [
|
|
-32.4,
|
|
0.0,
|
|
-32.4
|
|
],
|
|
"max": [
|
|
32.4,
|
|
0.0,
|
|
32.4
|
|
]
|
|
},
|
|
"start": [
|
|
32.4,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"end": [
|
|
32.4,
|
|
0.0,
|
|
0.0
|
|
]
|
|
},
|
|
{
|
|
"kind": "edge",
|
|
"index": 3,
|
|
"geom_type": "CIRCLE",
|
|
"center": [
|
|
8.820713588690454e-14,
|
|
0.0,
|
|
5.492201376236126e-16
|
|
],
|
|
"length": 116.23892818282235,
|
|
"bbox": {
|
|
"min": [
|
|
-18.5,
|
|
0.0,
|
|
-18.5
|
|
],
|
|
"max": [
|
|
18.5,
|
|
0.0,
|
|
18.5
|
|
]
|
|
},
|
|
"start": [
|
|
18.5,
|
|
0.0,
|
|
-4.531193156845207e-15
|
|
],
|
|
"end": [
|
|
18.5,
|
|
0.0,
|
|
-4.531193156845207e-15
|
|
]
|
|
}
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "edges",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
-0.0,
|
|
1.0,
|
|
0.0
|
|
],
|
|
"plane_x_dir": [
|
|
-1.0,
|
|
-0.0,
|
|
0.0
|
|
],
|
|
"selections": [
|
|
{
|
|
"kind": "edge",
|
|
"index": 1,
|
|
"geom_type": "CIRCLE",
|
|
"center": [
|
|
1.5209269266911748e-13,
|
|
0.0,
|
|
-8.670602095899002e-16
|
|
],
|
|
"length": 203.57520395261858,
|
|
"bbox": {
|
|
"min": [
|
|
-32.4,
|
|
0.0,
|
|
-32.4
|
|
],
|
|
"max": [
|
|
32.4,
|
|
0.0,
|
|
32.4
|
|
]
|
|
},
|
|
"start": [
|
|
32.4,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"end": [
|
|
32.4,
|
|
0.0,
|
|
0.0
|
|
]
|
|
},
|
|
{
|
|
"kind": "edge",
|
|
"index": 3,
|
|
"geom_type": "CIRCLE",
|
|
"center": [
|
|
8.820713588690454e-14,
|
|
0.0,
|
|
5.492201376236126e-16
|
|
],
|
|
"length": 116.23892818282235,
|
|
"bbox": {
|
|
"min": [
|
|
-18.5,
|
|
0.0,
|
|
-18.5
|
|
],
|
|
"max": [
|
|
18.5,
|
|
0.0,
|
|
18.5
|
|
]
|
|
},
|
|
"start": [
|
|
18.5,
|
|
0.0,
|
|
-4.531193156845207e-15
|
|
],
|
|
"end": [
|
|
18.5,
|
|
0.0,
|
|
-4.531193156845207e-15
|
|
]
|
|
}
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": false
|
|
},
|
|
{
|
|
"op": "Workplane",
|
|
"plane_origin": [
|
|
0.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"plane_normal": [
|
|
0.0,
|
|
0.0,
|
|
1.0
|
|
],
|
|
"plane_x_dir": [
|
|
1.0,
|
|
0.0,
|
|
0.0
|
|
],
|
|
"produced_solid": true
|
|
}
|
|
],
|
|
"stem": "washer",
|
|
"family": ""
|
|
}
|