Skip to content

feat(brep): wraps onto a cone - #61

Open
Basnederveen wants to merge 6 commits into
OpenGeometry-io:mainfrom
Bas-Automation-Services:feat/cone-wrap
Open

Basnederveen wants to merge 6 commits into
OpenGeometry-io:mainfrom
Bas-Automation-Services:feat/cone-wrap

Conversation

@Basnederveen

Copy link
Copy Markdown

What

Wraps onto a cone. Builds on #38 (wrapped curves and surfaces): this branch contains #38's commits, and the last three are new. Review those against feat/wrapped-geometry, or after #38 lands.

  • Wrap gains semi_angle (default 0: the cylinder exactly as before, bit for bit). A non-zero half angle rolls the flat plane onto the cone through the reference circle, developed: x is arc length along the reference circle, y runs along a generator, z is the radius plus the offset off the cone. Lengths on the cone are kept; off it the sheet stretches across the generators, as a rolled sheet's walls do.
  • point, push, second, push_normal (cofactor form), flatten (now hinted by a flat point), enclose and derivative_bounds (now over a flat box) follow it.
  • Bounds past a quarter turn around the apex: flat boxes reaching more than 90° around the apex enclose by their corners' angles; one reaching across the cut behind the apex is singular.
  • Bounds round the apex in parts: a wrapped surface or curve whose flat box contains the apex (a notch circling it, say) was refused as singular though the patch keeps clear of it, and the tessellator bounds every face. Such a domain is now halved, up to six times (WRAP_SPLITS), and the parts' bounds joined.

Use: rolled cones in sheet metal, with holes, cut-outs and notches modelled flat and wrapped exactly (Gusset's cones run on this, checked against a reference CAD's parts).

Tests

  • a_cone_wrap_develops_its_cone_and_round_trips (both half-angle signs): the reference circle and generators land on the cone, lengths kept; push against finite differences; point/flatten round trip, with the flat-point hint picking the right turn; flat-box bounds contain sampled points, past a quarter turn too; a box over the apex is refused; an invalid half angle fails validate.
  • a_wrapped_patch_round_a_cone_apex_bounds_in_parts: the patch's box holds the apex, enclose on it alone is singular, the surface's bounds in parts contain sampled points.
  • cargo fmt --check, cargo clippy --all-targets -D warnings and the source rules pass.

Files

  • main/opengeometry/src/brep/geometry/wrap.rs, surface.rs, curve.rs, tests.rs
  • semi_angle: 0.0 added where a Wrap is built: brep/builder/fixtures.rs, exchange/fit_bezier/tests.rs, exchange/preflight.rs

🤖 Generated with Claude Code

Basnederveen and others added 6 commits November 1, 2026 12:15
…n axis)

A Wrap maps flat space onto a cylinder the way a sheet metal bend wraps a
flat sheet: (x, y, z) -> frame.point([z cos(x/r), z sin(x/r), y]). x is arc
length on radius r, y runs along the axis, z is the distance from it.
CurveGeometry::Wrapped and SurfaceGeometry::Wrapped wrap a line, circle,
ellipse or any elementary surface exactly and keep its parameters and charts.
A hole through a bend is a wrapped cylinder bounded by wrapped circles; a
slanted cut is a wrapped plane bounded by helices.

- geometry: point, derivatives (chain rule), normal (cofactor), projection
  (exact on the surface), conservative bounds for curves and surfaces.
- tessellation: grid sizes and chord deviation from the exact second
  derivatives, sampled with a 1.5x margin; arcs keep the per-turn floor.
- query: ray roots on wrapped faces by UV subdivision plus Newton.
- STEP: wrapped surfaces as bicubic B-splines over the support's face UV,
  reaching 10% past the faces (never around a period onto itself) so readers
  that rebuild trims by intersecting neighbouring surfaces don't trim short;
  wrapped edges as cubic B-splines; both Hermite fits checked against the
  exact geometry and charged to the exchange budget.
- placement moves wrapped geometry rigidly; scaling, mirroring, booleans,
  shells, SSI and IFC refuse it with UnsupportedGeometry.

Tests: wrapped families in the per-family geometry tests, fitting tests, and
a bend sector with a slanted wrapped side that meshes to its exact volume,
classifies points on both sides of the wall, exports to STEP within budget,
and refuses scaling, mirroring, booleans and shelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VFZvqx1RmXzPtbL9VXP4H7
Wrap gains semi_angle (default 0, the cylinder as before, bit for bit). A
non-zero half angle rolls the flat plane onto the cone through the reference
circle, developed: x is arc length along the reference circle, y runs along a
generator, z is the radius plus the offset off the cone. Lengths on the cone
are kept; off it the sheet stretches across the generators, as a rolled
sheet's walls do. point, push, second, push_normal (cofactor), flatten (now
hinted by a flat point), enclose and derivative_bounds (now over a flat box)
follow it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Boxes more than 90 degrees around the apex in the flat enclose by their
corners' angles; one reaching across the cut behind the apex is singular.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e apex

A wrapped surface or curve whose flat box contains the apex (a notch
circling it) was refused as singular though the patch keeps clear of
it; the tessellator's magnitude pass bounds every face. Such a domain is
now halved up to six times and the parts' bounds joined.

This branch has not been deployed

No deployments
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