Repository navigation
feat(cad): add multi-profile LoftGeometry + audit fixes for SweepGeometry/HelixGeometry - #98
Merged
Merged
Conversation
jbingham
force-pushed
the
feat/cad-loft-geometry
branch
from
November 13, 2026 15:18
ab4de3c to
b321410
Compare
jbingham
force-pushed
the
feat/cad-loft-geometry
branch
from
November 13, 2026 15:19
b321410 to
96ab361
Compare
- Right-handed helices now rise counter-clockwise seen from +Y. - Smooth-shaded sweep/loft walls with crease detection. - Closed sweeps round twist to whole turns and weld the seam. - 100k vertex quota for SweepGeometry and LoftGeometry. - Path lofts map station offsets onto the spine; ring count capped at 512. - Closed lofts use the seam-aligned closing ring. - One-axis scale collapse emits full quads; negative loft height stays outward. - Document steps clamps, closed/openTop/wallThickness rules, ignored holes. - Add Sweep/Helix/Loft to LLM guide, skills, llms.txt and AI prompts. - Bundle budgets: cad < 17, full < 231, xr-full < 340 KB gz.
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
Implements Stage 2 of the CAD & Pattern enhancement plan in
three-live-cad(multi-profileLoftGeometry) and lands the post-merge audit fixes for #97 (SweepGeometry/HelixGeometry), since both share the same wall/cap emitters.THREE.LoftGeometry(stations, options?)Shape,[x, y][], or{ shape, y | offset, scale, twist, translate }stations) into a watertight 2-manifold mesh: square-to-round table legs, vases, handles, fairings, tapered housings.profileSegmentsvertices and cyclically shifted to minimize twist against its neighbor (no diagonal creasing when blending a square into a circle).'linear'(default) or'smooth'/'catmull-rom'(Catmull-Rom with a 15% overshoot clamp; needs >= 3 stations).axis: 'y' | 'z' | 'x', or a 3Dpath(Bishop frames); station offsets map proportionally onto the spine.closed: true(withpath) loops back to the first station.openTop: true+wallThicknessbuilds outer wall, rim annulus, inner cavity, and inner floor in one watertight shell (vases, cups, planters, lampshades) without CSG. The inner wall contracts about the bounding-box center: exact for centered circles/rectangles, approximate otherwise.shape.holesare ignored (documented).Audit fixes for #97 (
SweepGeometry,HelixGeometry) and Stage 2'right'helix was actually left-handed. It is now counter-clockwise rising when seen from +Y (positive torsion); the test now checks the torsion sign.TubeGeometrywhile box/hex profiles keep sharp edges.twistis rounded to whole turns and the end cross-section is welded to the start, so closed loops with odd twist or a taper no longer leave a seam gap.SweepGeometryandLoftGeometrythrow aRangeError(SecurityError) before allocating more than 100,000 vertices; at most 64 sweep shapes and 256 loft stations are used.steps: 1stopped mid-spine and > 512 rings piled up at the end); total rings are capped at 512.scale: u => [u, 1]) now emits full quads instead of leaving holes.heightno longer turns the mesh inside out.stepsclamps and defaults, documentedclosed/openTop/wallThicknessrequirements, and addedSweepGeometry/HelixGeometry/LoftGeometryto the LLM guide, authoring skill,llms.txt, and the AI edit / image-to-scene prompts (with matching Rust prompt mirrors incompiler/src/ai_edit.rsandai_image.rs).Bundle budgets
three-live-cad.min.jsis 16.0 KB gz, so the budget moves from< 16to< 17 KB gz.three-live-fullmoves to< 231(229.7 KB) andxr-live-fullto< 340(338.6 KB).Testing
node scripts/build.js --test: all suites pass (three-author124/124), including new regression tests for helix torsion, closed odd-twist/tapered sweeps, seam-shifted closed lofts,steps: 1path lofts, offset-to-spine mapping, negative height, the vertex quota, one-axis collapse, and smooth-vs-crease normals.cargo test --manifest-path compiler/Cargo.toml: passes.