Files
make-cad/test/cadquery_traces/rarray_plate.trace.json
T
NiJingzhe 216a7ed625 feat: CadQuery→FTC translator toolset under tools/research (cadqueryftc)
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.
2026-09-08 15:53:51 +08:00

419 lines
6.5 KiB
JSON

{
"cq_status": "ok",
"error": "",
"cq_volume": 213510.268572,
"cq_bbox": [
-6.99,
-55.345,
-77.13,
6.99,
55.345,
77.13
],
"steps": [
{
"op": "Workplane",
"args": [
"YZ"
],
"plane_name": "YZ",
"plane_origin": [
0.0,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.0,
0.0
],
"produced_solid": false
},
{
"op": "box",
"args": [
110.69,
154.26,
13.98
],
"plane_origin": [
0.0,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.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": [
">X"
],
"plane_origin": [
0.0,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.0,
0.0
],
"selector": ">X",
"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": ">X",
"selections": [
{
"kind": "face",
"index": 5,
"geom_type": "PLANE",
"center": [
6.99,
1.970645868709653e-15,
5.135370752625171e-15
],
"normal": [
1.0,
0.0,
0.0
],
"area": 17075.039399999998,
"bbox": {
"min": [
6.99,
-55.345,
-77.13
],
"max": [
6.99,
55.345,
77.13
]
}
}
],
"produced_solid": false
},
{
"op": "workplane",
"plane_origin": [
0.0,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.0,
0.0
],
"selections": [
{
"kind": "face",
"index": 5,
"geom_type": "PLANE",
"center": [
6.99,
1.970645868709653e-15,
5.135370752625171e-15
],
"normal": [
1.0,
0.0,
0.0
],
"area": 17075.039399999998,
"bbox": {
"min": [
6.99,
-55.345,
-77.13
],
"max": [
6.99,
55.345,
77.13
]
}
}
],
"produced_solid": false
},
{
"op": "Workplane",
"args": [
"Plane(origin=(6.99, 0.0, 0.0), xDir=(0.0, 1.0, 0.0), normal=(1.0, 0.0, 0.0))"
],
"plane_name": "Plane(origin=(6.99, 0.0, 0.0), xDir=(0.0, 1.0, 0.0), normal=(1.0, 0.0, 0.0))",
"plane_origin": [
6.99,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.0,
0.0
],
"produced_solid": false
},
{
"op": "rarray",
"args": [
20.37,
75.31,
4,
2
],
"plane_origin": [
6.99,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.0,
0.0
],
"produced_solid": false
},
{
"op": "pushPoints",
"args": [
[
[
-30.555,
-37.655,
0.0
],
[
-30.555,
37.655,
0.0
],
[
-10.184999999999999,
-37.655,
0.0
],
[
-10.184999999999999,
37.655,
0.0
],
[
10.185000000000002,
-37.655,
0.0
],
[
10.185000000000002,
37.655,
0.0
],
[
30.555,
-37.655,
0.0
],
[
30.555,
37.655,
0.0
]
]
],
"plane_origin": [
6.99,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.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": "rect",
"args": [
11.65,
38.68
],
"plane_origin": [
6.99,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.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": "cutBlind",
"args": [
-6.99
],
"plane_origin": [
6.99,
0.0,
0.0
],
"plane_normal": [
1.0,
0.0,
0.0
],
"plane_x_dir": [
0.0,
1.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": "rarray_plate",
"family": ""
}