Skip to content

feat(microscope-slide-holder): explicit fit_clearance_slide behind the legacy material injection - #109

Merged
aldoruizluna merged 2 commits into
mainfrom
feat/explicit-fit-params-microscope-slide-holder
Oct 2, 2026
Merged

aldoruizluna merged 2 commits into
mainfrom
feat/explicit-fit-params-microscope-slide-holder

Conversation

@aldoruizluna

@aldoruizluna aldoruizluna commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Digital Twins MES, Phase 2 wave 2, lane W2-MAT. Owner ruling: "flag now, flip later". This PR is the commons side that lets yantra4d turn RENDER_MATERIAL_INJECTION off without losing function.

  • libs/microscope-slide-hyperobject/slide.scad (the vendored library, which rides with this cartridge): slide_slot_width() now adds fit_clearance_slide (mm, default 0). The legacy mat_clear_slide is undef unless the platform injects it with -D, and an injected value wins (_legacy_or()). Every render made with the flag on is therefore unchanged. The legacy branch is commented REMOVE AT THE FLIP. The header is the same text as microscope-slide-hyperobject's PR; the vendored file's rib module is untouched.
  • project.json: declares fit_clearance_slide (slider 0 to 1 mm, step 0.01, group tolerance, advanced visibility, labels in en/es/fr/pt), visible in the OpenSCAD modes that call slot_width(): box, staining_rack and cabinet_drawer.

What the legacy injection does to this cartridge today (measured)

  • -D mat_clear_slide does reach geometry, even through use <slide_lib.scad> → include <libs/…/slide.scad>. The -D render is identical to a render with the literal edited in the source.
  • It moves box (base and lid) and cabinet_drawer (drawer and shell) at every SCAD preset.
  • staining_rack is inert at defaults and at every preset, because of its 5 mm minimum pitch. It is reachable only for thick slides near the slider maxima.
  • tray never calls slot_width().
  • mat_shrinkage_*, mat_clear_press, mat_clear_loose and thermo_* are inert here.
  • The CadQuery modes (main.py) read none of them, and this PR does not touch main.py.

GOC-1 mapping

  • fit_clearance_slide passes the GOC-1 variables denylist; I checked it against generator-output.schema.json. After the flip, a resolved sliding-fit clearance reaches this cartridge as a geometry-named number in variables, and legacy_physical_inputs stays empty.
  • The manifest default (0.0) equals the library literal. With RENDER_INJECT_FULL_PARAMS on, the geometry is unchanged (row A4).

Evidence

I rendered locally with OpenSCAD 2026.02.13 and --backend=Manifold. Geometry was compared as volume, AABB, body count and the sha256 of the sorted unique vertex set rounded to 1e-4, never as STL bytes.

The matrix is 6 SCAD targets (box base and lid, tray, staining_rack, cabinet_drawer drawer and shell) × 9 parameter sets (defaults plus the 8 SCAD presets) = 54 rows. Each row has 6 checks, 324 comparisons in total, with 0 mismatches:

Check Meaning
A0 after, no material = before, no material today's no-material render is unchanged
A4 after, fit_clearance_slide=0.0 = before, no material explicit defaults (injection OFF) = today's no-material render
A1 after, bambu-tpu-95a injected = before, TPU injected geometry is unchanged with injection ON
A5 after, sinterit-pa12-smooth injected = before, PA12 injected same, second material
A2 after, explicit fit_clearance_slide=0.1 = before, TPU injected the explicit parameter carries the function
A3 after, TPU injected plus explicit 0.5 = before, TPU injected the injected value wins

For example, at defaults box_base measures 86312.824 mm³ with no material and 86893.175 mm³ with TPU, and cabinet_drawer shell measures 235996.166 mm³ and 241873.840 mm³.

y4d-spec check ./microscope-slide-holder --render --require-openscad --parity --openscad-path libs --openscad-path .:

  • at the CI pin 3ff3736: cartridges=1 failures=0 notes=0 geometry=verified renders=19 presets=9 skipped=0 parity=0/0 ok
  • at the P2-S head (510efba): failures=0 notes=19. All 19 notes are pre-existing default-drift notes on other parameters; unmodified main gives the same notes=19. None concerns fit_clearance_slide.

CI status

Green on Linux CI (own runners) at the time of writing: manifest conformance (all cartridges) passed in 38s, render scope passed, and render (cartridges changed in this PR: microscope-slide-holder) passed in 2m18s.

Deviations / notes

  • No target_material change; this cartridge never declared it.
  • The vendored libs/microscope-slide-hyperobject/{project.json,slide.py,README.md} are not re-synced. The holder executes only the vendored slide.scad.

🤖 Generated with Claude Code

aldoruizluna and others added 2 commits October 2, 2026 15:21
…e legacy material injection

Declare fit_clearance_slide (mm, default 0.0) for the OpenSCAD box,
staining rack and cabinet drawer. The vendored slide library reads it in
slide_slot_width(); while yantra4d RENDER_MATERIAL_INJECTION is on, an
injected mat_clear_slide still wins, so today's geometry is unchanged. The
legacy branch is marked for removal at the flip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aldo Ruiz Luna <aldo.ruiz.luna@gmail.com>
…the fit clearance tooltip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aldo Ruiz Luna <aldo.ruiz.luna@gmail.com>
@aldoruizluna
aldoruizluna marked this pull request as ready for review October 2, 2026 22:26
@aldoruizluna
aldoruizluna merged commit 920aefb into main Oct 2, 2026
6 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