Skip to content

feat(planning): typed mandrel surface model; route cylinder through it - #309

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/cone-s1-surface-model
Jun 29, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/cone-s1-surface-model

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Summary

Stage 3a S1 (byte-safe plumbing) of #306 / epic #138. Introduces the typed mandrel surface model and routes the existing cylinder geometry through it with no behavioural change.

  • New fiberpath/planning/surface.py: Cylinder{radius} and Cone{r0, r1, length}, both is_developable() → True, with radius_at / diameter_at / circumference_at.
  • Routed the two cylinder-geometry reads through the model:
    • calculations.py — helical mandrel_circumference → Cylinder(...).circumference_at(0.0)
    • developed.py — hoop delivery_head_lean → surface.diameter_at(0.0)
  • Cone is defined but not planned; its z-dependent winding kinematics (varying circumference/pitch/dwell on the unrolled sector) land in S2 (Stage 3a S2 — cone kinematics & unrolled-sector development + harness extension #307).

Byte-safety

The cut-over is bit-identical. A Cylinder built from diameter / 2 reproduces the legacy reads exactly because 2 * (d / 2) == d for all normal floats (both steps are pure exponent shifts):

  • circumference_at(0.0) ≡ legacy math.pi * mandrel.diameter
  • diameter_at(0.0) ≡ legacy mandrel.diameter (so the hoop atan(d / tow.width) arg is unchanged)

All example goldens and fixtures are unchanged. Independently verified by adversarial review over 2M random diameters (zero mismatches across the normal-float range).

Scope boundary (deliberate)

metrics.py (nominal_metrics) also reads math.pi * mandrel_diameter, but it is intentionally not routed through the surface model: it consumes the Motion IR's scalar mandrel_diameter and is surface-agnostic by design (the IR is decoupled from the planning surface). Cone-aware metrics are an S2/S3 design question, not an S1 routing.

Verification

  • pytest — 198 passed (192 prior + 6 new surface tests), goldens byte-identical
  • ruff format --check, ruff check, mypy — all clean

Closes #306.

Introduce fiberpath/planning/surface.py with Cylinder{radius} and
Cone{r0,r1,length} (both is_developable()), and route the two cylinder
geometry reads -- helical circumference and hoop delivery-head lean --
through it. The cut-over is byte-identical: a Cylinder built from
diameter/2 reproduces the legacy `math.pi * diameter` and `mandrel.diameter`
reads to the bit (2*(d/2)==d is exact for all normal floats), so all example
goldens and fixtures are unchanged.

Cone is defined but not yet planned; its z-dependent winding kinematics land
in S2. The IR-consumer metrics layer (nominal_metrics) stays surface-agnostic
by design and is intentionally not routed through this model.

S1 of #138 (Stage 3a cones).
@CameronBrooks11
CameronBrooks11 merged commit a874c6b into main Jun 29, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/cone-s1-surface-model branch June 29, 2026 18:45
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.

Stage 3a S1 — typed surface model (Cylinder/Cone); route cylinder through it byte-safe

1 participant