Skip to content

Commit 3ec3453

Browse files
aldoruizlunaclaude
andauthored
feat(z-drive-housing): graph twin of the script (graph format 1.1) (#173)
z-drive.graph.json is a golden twin of main.py, declared as graph_file on the z_drive mode beside the script (owner decision D5: graph twins coexist with scripts, parity-checked; main.py stays the rendered source and the oracle). Digital Twins phase 8b, lane P8-TWINS-B. Same parameters (declared in `parameters`, `mirrored` included), same derivations (the five clamps as ternary pairs in `derived`, the min/max of X0, X1 and the corner key's end as ternaries, the stations A_IN..C_OUT and the constants under main.py's names and values) and the same operations in the same order: every loop (walls, mount screws, bearing seats, motor screw slots) unrolled, each _slot_y the two end cylinders and the web box. `mirrored` selects the pure YZ `reflect` of the body, as body.mirror("YZ") does. Each _cyl_y is an XZ profile_circle built at the origin, extruded along +Y, turned -90 degrees about y so the cylinder's seam sits at +Z where makeCylinder puts it, then translated into place. y4d-spec check --render --require-openscad --parity ./z-drive-housing: 10 renders, parity 5/5 at 0.000000 mm (defaults + corner_right, corner_left, loop_tensioned, deep_plane_wide_offset; the two mirrored presets included), frames 50/50 ok, failures 0. Frames and presets unchanged. Assembly A validates (235/235 placed, 292/292 mates, poses 23/23); its digest moves cb80b679... -> d6673f24... because the cartridge gains a file. Signed-off-by: Aldo Ruiz Luna <aldo.ruiz.luna@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5d9cd22 commit 3ec3453

3 files changed

Lines changed: 250 additions & 0 deletions

File tree

‎z-drive-housing/docs/README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ Z idler and the Z pulley share one belt plane and one vertical.
150150
- **Deeper Belt Plane, Wider Offset, Left-Hand.** `belt_offset` 20, `belt_plane` 24,
151151
`mount_pitch` 24, mirrored. This is for a top idler set further into the frame.
152152

153+
## Graph twin
154+
155+
`z-drive.graph.json` is a node-graph twin of `main.py` (graph format 1.1). It has the same parameters, the same derivations and the same operations in the same order. Each `_box` is a centred `box` translated to its centre, each clamp a min/max ternary pair in `derived`, and the plain `min`/`max` of `X0`, `X1` and the corner key's end ternaries. Each `_cyl_z` is an XY `profile_circle` extruded and translated to its start. Each `_cyl_y` is an XZ `profile_circle` built at the origin, extruded along +Y (the XZ normal is −Y), turned −90° about y so the cylinder's seam sits at +Z where `makeCylinder` puts it, then translated into place; the seam decides where the tessellator puts vertices. Each `_slot_y` is the two end cylinders and the web box, unioned as in the script, and every loop (walls, mount screws, bearing seats, motor screw slots) is unrolled in the script's order. `mirrored` is a `select` between the body and its pure YZ `reflect`, as `body.mirror("YZ")`. The constants keep `main.py`'s names, values and sources.
156+
- **Declaration.** The mode declares it as `graph_file` next to the script.
157+
- **Verification.** `y4d-spec check --render --parity` compares the two at the defaults and at every preset (`corner_right`, `corner_left`, `loop_tensioned`, `deep_plane_wide_offset`; the two mirrored presets included); they agree to 0.000000 mm.
158+
- **Which one renders.** `main.py` stays the source the platform renders and the oracle the graph is checked against. A script retires only after parity holds across the nightly sweep (owner decision D5, 2026-10-04).
159+
153160
## Hyperobject Profile
154161

155162
- **Domain:** industrial.

‎z-drive-housing/project.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
},
4444
"scad_file": "main.py",
4545
"cq_file": "main.py",
46+
"graph_file": "z-drive.graph.json",
4647
"parts": [
4748
"z_drive"
4849
],

0 commit comments

Comments
 (0)