Repository navigation
Description
Stage 3b · Phase 1 — geodesic path on a curved surface (Von Kármán nosecone, software-only). Parent epic: #139.
The first shippable slice of general surfaces of revolution. Adds the first non-developable profile surface and a numeric geodesic path builder, reusing the Stage 3a cone seams. Software-only, zero hardware risk — it proves the geometry end-to-end and produces a planned/simulated/plotted/G-code-exportable VK toolpath with an (expected) bare polar cap near the tip. Full tip coverage is Phase 2 (#327).
Refined 2026-08-08 after a full code-map + numeric validation + 4-critic adversarial assessment. Detailed plan (rev 2):
working/vk-phase1-plan.md, posted as a comment below. The bullets here reflect the refined decisions.
Why this is unblocked
The Stage 3a cone survey shows the seams are surface-agnostic: lower_developed_path makes no developability assumption; _validate_coverage is surface-independent; dispatch is two isinstance ladders. The one genuine new piece is a numeric Clairaut quadrature replacing the cone's closed-form θ(z) (a cone unrolls flat; a VK profile does not):
θ(z) = ∫ C / ( r(z)·√(r(z)² − C²) ) · √(1 + r′(z)²) dz , C = R·sin α
Scope (refined)
- Surface —
VonKarman{length}inplanning/surface.py, base radius frommandrelParameters.diameter/2(no separatebaseDiameter— it would duplicatediameter). Providesradius_at,radius_slope_at(analytic r′, cancelled closed form),is_developable() → False(first such). VK LD-Haack:θ_p=arccos(2z/L−1),r=(R·π^-0.5)·√(θ_p−sin2θ_p/2), base at z=0. - Kinematics — generic
compute_profile_helical_kinematics+profile_geodesic_theta_deg+profile_local_alpha_degincalculations.py. Numeric θ on a fine fixed grid (~0.1 mm, error budget ≤1e-3° at the cap) → cumulative table, interpolated at the ~1 mm emitted stations. Nomath.sqrt(token (CI single-source guard pins it tometrics.py): usemath.hypot,((r−C)*(r+C))**0.5,**0.5. Mandatory domain clamps (arccos arg to [−1,1];max(0,·)before**0.5). - Reachability / polar cap — the geodesic can't cross r=C, so every VK helical leaves a bare cap; the validator reports it (does not reject on the cap). Report both
2Cand the actual2·r(z_cap). Reject only an unusable wound band (min(windLength,z_cap) ≤ lead_inorC ≥ R).z_capfloored to the integer station lattice + a boundary-clearance assertion so the cross-platformlen(moves)gate can't flip. - Builder —
build_profile_helical_developed_path(cone-builder structure, θ/α from the profile sources, pass end =min(windLength, z_cap)); reuselower_developed_pathuntouched. Uniform ~1 mm emitted stations (chord error accepted for Phase 1). - Validator + dispatch —
validate_profile_helical_layer; hoop-on-VK rejected, skip allowed. Dispatch the numeric path onnot surface.is_developable(); end both ladders exhaustively; build the per-layer mandrel re-wrap withmodel_copy(update=…). -
.wind— additive discriminatedmandrelParameters.profile = {type:"vonKarman", length},schemaVersion 1.2(already allowed by^1\.\d+$).model_validatorrejectsprofile+endDiameterboth-set →WindFileError(parse-time; not a bareValueError). Regeneratewind-schema.json+openapi.json+ TS types (drift gates). Wind-format doc + changelog + a "known approximations" note (base-radius metrics on curved surfaces). - GUI guard — the GUI plans/saves from a reserialized model and silently strips unmodelled mandrel fields (see gui: cone endDiameter silently stripped on open/plan/save (.wind 1.1 data loss) #344). Add a blocking guard: refuse to plan/save a loaded
.windcarrying mandrel fields the model can't represent (coversendDiameter+profile). Full GUI editing → gui: edit/round-trip mandrelParameters.profile (Von Kármán) in the project model #345. - Example + tests —
examples/vk_nosecone/(equivalence-gated, noexpected.gcode, like the cone). Conformance valid + enumerated invalid fixtures (both-set, unusable-band) with exactmatchsubstrings. See the plan's §4 test matrix (differential integrator oracle, derivative-vs-finite-diff, table-interpolation, non-circular IR-delta geometry check + negatives, example-drivenassert_profile_*, in-process IR round-trip).
Definition of done
A .wind file with a VK profile plans a helical layer and emits Marlin G-code, gated by the equivalence harness (Clairaut geometry re-derived from the emitted IR + integer len(moves) structural gate), with the bare-cap diameter surfaced to the user (G-code comment + kinematics field). All existing cylinder/cone goldens stay byte-identical. No friction model, no new hardware axis.
Delivery
Ships as 3 sequential PRs: (1) surface + integrator (isolated math), (2) builder + validator + equivalence harness (internal VonKarman driver), (3) .wind field + dispatch + example + conformance + docs + regenerated artifacts + the GUI guard.
Explicitly out of scope (later)
- Full coverage to the tip → non-geodesic winding (Phase 2, Stage 3b · Phase 2 — non-geodesic winding + friction calibration knob (full tip coverage) #327).
- 4th-axis delivery kinematics for the steep near-tip region (Phase 3, Stage 3b · Phase 3 — delivery kinematics for steep profiles (radial cross-feed 4th axis) #328).
- Full GUI editing/round-trip of
profile(gui: edit/round-trip mandrelParameters.profile (Von Kármán) in the project model #345); the pre-existing coneendDiameterGUI data loss (gui: cone endDiameter silently stripped on open/plan/save (.wind 1.1 data loss) #344).
See docs/development/roadmap.md (Stage 3b) and the feasibility assessment on #139.
Activity
CameronBrooks11 commentedon Aug 8, 2026
Implementation plan (rev 2) — post-assessment
Produced from a full code map (geometry core / schema+format / test architecture) + independent numeric validation, then hardened by a 4-critic adversarial assessment (2026-08-08). The body checklist above reflects these decisions; this comment records the reasoning so it survives.
Key corrections the assessment caught
3.4e-5°was at 0.09 mm steps, not 1 mm; at a true 1 mm step the cone-limit error is ~4e-3° (worse near the cap), and per-station θ error accumulates into the mandrel angle. ⇒ integrate on a fine fixed grid (~0.1 mm, budget ≤1e-3° at the cap) decoupled from the ~1 mm emitted lay stations.r′(z)needs the cancelled closed form−(2R·π^-0.5/L)·sinθ_p/√(θ_p−sin2θ_p/2)— the naive chain rule is 0/0 at the base (z=0, first grid point). Grid built strictly on[0, z_cap](r′ diverges at the tip).max(0,·)before**0.5(a tiny negative base to**0.5returns a silent complex in Python).tan α_emp = r·Δθ/(√(1+r′²)·Δz)) and the differential integrator-vs-cone test. Surface test uses literature-pinned reference values, not the same formula twice.len(moves)integer gate is the cross-platform lock — protected by flooringz_capto the 1 mm station lattice + a boundary-clearance assertion (transcendental compares differ by ulps across the 3-OS libm matrix).Decisions
profile+endDiameterboth-set at a pydanticmodel_validator→WindFileError(parse-time; API 422; conformance-catchable). A bareValueErrorinsurface_from_mandrelwould be a 500 and escape the conformanceraises((WindFileError, PlanningError)).baseDiameteron the profile — base radius comes frommandrelParameters.diameter/2(avoids desyncing the machine/metrics that readdiameter).profilemachinery,VonKarmanconcrete surface; dispatch the numeric path onnot surface.is_developable()(extensible to domes, gives the flag a real consumer).min(windLength, z_cap)— one value feeds both the builder pass end and_validate_coverage.cap_diameterfield on the kinematics (report2Cand the actual2·r(z_cap)); a structuredwarningsfield is a noted optional upgrade.endDiameter+profile). Full editing → gui: edit/round-trip mandrelParameters.profile (Von Kármán) in the project model #345; the pre-existing coneendDiameterdata loss → gui: cone endDiameter silently stripped on open/plan/save (.wind 1.1 data loss) #344.Slicing (3 sequential PRs)
VonKarmandriver; harness re-derives r(z)/√(1+r′²) inline + negative tests incl. "θ table missing the meridian factor must fail"). No dispatch wiring yet (would be dead code without the schema field)..windfield + dispatch + example + conformance (enumerated invalid fixtures) + example-drivenassert_profile_*+ in-process IR round-trip + docs/regen + GUI guard.Full working plan:
working/vk-phase1-plan.md(local).feat(planning): add Von Kármán surface and numeric geodesic integrator
feat(planning): profile geodesic developed path, validator, equivalen…
chore(release): bump to 0.11.0 (#368)
docs: bring capability docs in line with what shipped, and add AGENTS…
CameronBrooks11 commentedon Oct 19, 2026
The local
working/vk-phase1-plan.mdreferenced above is gone. Its decisions are in this thread, its two follow-ups are #344 and #345, and its test strategy shipped astests/planning/test_profile.pyand the_equivalence.pyprofile checks.