Repository navigation
feat(brep): wraps onto a cone - #61
Open
Basnederveen wants to merge 6 commits into
Open
Basnederveen wants to merge 6 commits into
Basnederveen wants to merge 6 commits into
Conversation
…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
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
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.
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.Wrapgainssemi_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),encloseandderivative_bounds(now over a flat box) follow it.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;pushagainst 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 failsvalidate.a_wrapped_patch_round_a_cone_apex_bounds_in_parts: the patch's box holds the apex,encloseon it alone is singular, the surface's bounds in parts contain sampled points.cargo fmt --check,cargo clippy --all-targets -D warningsand the source rules pass.Files
main/opengeometry/src/brep/geometry/wrap.rs,surface.rs,curve.rs,tests.rssemi_angle: 0.0added where aWrapis built:brep/builder/fixtures.rs,exchange/fit_bezier/tests.rs,exchange/preflight.rs🤖 Generated with Claude Code