Skip to content

feat(xy-joint): graph twin of the script (graph format 1.1) - #170

Merged
aldoruizluna merged 1 commit into
mainfrom
feat/xy-joint-graph-twin
Oct 5, 2026
Merged

aldoruizluna merged 1 commit into
mainfrom
feat/xy-joint-graph-twin

Conversation

@aldoruizluna

Copy link
Copy Markdown
Contributor

What

Phase 8b, lane P8-TWINS-A (Digital Twins MES programme). xy-joint/xy-joint.graph.json is a node-graph twin of xy-joint/main.py, in graph format 1.1.

  • Declaration. It is declared as graph_file on the xy_joint mode, next to the script.
  • Which one renders. Owner decision D5 applies: graph twins coexist with scripts and are parity-checked. main.py stays the rendered source and the oracle.
  • Unchanged: frames, presets and parameters. docs/README.md gains a "Graph twin" section (en) and a paragraph in the Resumen (es).
  • How the twin is built:
    • It has the same parameters, declared in parameters.
    • It has the same derivations:
      • the idler_width and d_end clamps are ternary pairs;
      • the belt levels, the raised element's boss, the post's top (max) and its inboard edge (min) are ternaries.
    • It performs the same operations in the same order.
    • The script's if mirrored: seat ring is a select.
    • The right-hand joint is body.mirror("YZ"), expressed as reflect YZ chosen by select on mirrored.
  • Seam. D's back-slot screw runs along +Y. A Z cylinder laid down with rotate x −90 and spun with rotate y −90 puts the B-rep seam where makeCylinder puts it (x direction +Z). An XZ profile_circle + extrude would put it at +X, which measured up to 0.0019 mm off on some diameters.

Evidence

Run locally on keystone main eeb46798, with OpenSCAD 2026.02.13:

y4d-spec check ./xy-joint --render --require-openscad --parity --openscad-path libs --openscad-path . -v
parity (…, cadquery vs graph): ok — Meshes are identical within 0.000000mm tolerance.   (defaults, left_350, right_350 [mirrored], left_10mm_idler, right_10mm_idler [mirrored])
y4d-spec check: cartridges=1 failures=0 notes=1 … renders=10 presets=8 … parity=5/5 ok, warn=0, exempt=0, placement=0, failures=0 frames=50/50 ok, unverified=0, failures=0

The one note is pre-existing: the frame grammar uses ASM-1 v1.1.0 let.

  • Structural check: rc 0.
  • pytest .github/scripts: 59 passed.
  • assembly_check.py + y4d-spec assembly check --collision: checked=2 failed=0. Assembly A has 235/235 placed, 292/292 mates, 23/23 poses and errors=0.

Assembly A's digest moves. It goes from cb80b6790dbc7047… (solid main 345bc45) to 85362cde6e9f62132f247de968efe6f75c385eb9ecfac3ea41ee2e8d37a6ac3c (this PR alone). The keystone fixture follows later, in one refresh the coordinator schedules.

Landing

SPEC_PIN 142db18 already carries graph format 1.1. Draft: the coordinator merges.

🤖 Generated with Claude Code

xy-joint.graph.json is a golden twin of main.py, declared as graph_file on the
xy_joint mode beside the script (owner decision D5: graph twins coexist with
scripts, parity-checked; main.py stays the rendered source and the oracle).

Same parameters (declared in `parameters`), same derivations (the idler_width
and d_end clamps as ternary pairs; the levels, the raised element's boss, the
post's top as max() and its inboard edge as min(), all as ternaries), same
operations in the same order. The script's `if mirrored:` seat ring is a
`select`; the right-hand joint is body.mirror("YZ") as `reflect` YZ chosen by
`select` on mirrored. D's back-slot screw runs along +Y: a Z cylinder laid
down by rotate x -90 and spun by rotate y -90 puts the B-rep seam where
makeCylinder puts it (x direction +Z).

y4d-spec check --render --require-openscad --parity ./xy-joint: 10 renders,
parity 5/5 agree to 0.000000 mm (defaults + left_350, right_350 (mirrored),
left_10mm_idler, right_10mm_idler (mirrored)), frames 50/50 ok, failures 0.
Frames and presets unchanged. Assembly A still validates with --collision
(235/235 placed, 292/292 mates, 23/23 poses, errors 0); its digest moves
because the GOC-1 tree of xy-joint gains a file.

Signed-off-by: Aldo Ruiz Luna <aldo.ruiz.luna@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aldoruizluna
aldoruizluna marked this pull request as ready for review October 5, 2026 11:53
@aldoruizluna
aldoruizluna merged commit 5d9cd22 into main Oct 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant