Repository navigation
feat(planning): typed mandrel surface model; route cylinder through it - #309
Merged
Merged
Conversation
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).
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
fiberpath/planning/surface.py:Cylinder{radius}andCone{r0, r1, length}, bothis_developable() → True, withradius_at/diameter_at/circumference_at.calculations.py— helicalmandrel_circumference→Cylinder(...).circumference_at(0.0)developed.py— hoopdelivery_head_lean→surface.diameter_at(0.0)Coneis 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
Cylinderbuilt fromdiameter / 2reproduces the legacy reads exactly because2 * (d / 2) == dfor all normal floats (both steps are pure exponent shifts):circumference_at(0.0)≡ legacymath.pi * mandrel.diameterdiameter_at(0.0)≡ legacymandrel.diameter(so the hoopatan(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 readsmath.pi * mandrel_diameter, but it is intentionally not routed through the surface model: it consumes the Motion IR's scalarmandrel_diameterand 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-identicalruff format --check,ruff check,mypy— all cleanCloses #306.