Repository navigation
fix(tessellation): Delaunay meshing of curved trimmed faces, without needle triangles - #60
Open
Basnederveen wants to merge 4 commits into
Open
Basnederveen wants to merge 4 commits into
Basnederveen wants to merge 4 commits into
Conversation
…ipping locally Splitting every deviating edge per round and re-flipping stalled near finely sampled trims (a few dozen splits a round against a 128 round cap). A queue of edges, each split at its midpoint with Lawson flips around it, has no round cap and touches only the triangles it changes.
…triangles Earcut turns runs of collinear trim samples (a straight trim edge in uv) into zero-area triangles, which flips and splits cannot resolve: an edge along the run met its own vertices and refinement either cycled or left it unsplit. Samples now snap to a shared coordinate where they agree to the geometric accuracy, earcut sees only the runs' corners, and the run samples go back in by splitting the boundary edge they lie on. Flips use one collinearity tolerance throughout.
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
Needle triangles on curved faces with holes or notches.
general_curved_trimmed_faceearcuts the trim ring in UV and refines edges that stray from the surface. Earcut produces long fans of needle triangles from the trim samples, and refinement only splits them further, so the mesh area overshoots the exact face: a half cylinder with a hole meshed +69 mm² at deflection 0.1, a curved slot through a cylinder +793 mm². At the finest deflections refinement could also stall against its 128 round cap.tessellation/delaunay.rs,Triangulation): after earcut, Lawson flips in UV scaled by the surface'suv_metricturn the fans into a Delaunay triangulation; trim edges stay fixed.edges_to_split,add_edge_midpointsandrefined_trianglesgo.snap_axis_noise), earcut sees only each run's corners (straight_run_corners), and the run samples go back in by splitting the boundary edge they lie on.Result on the two cases above: about −4.5 mm² (the inscribed-mesh deficit), with roughly 10× fewer triangles, and deflection 0.001 now meshes where it failed before.
Tests
tessellation/tests/delaunay.rs: flips turn a fan of needles Delaunay; flips remove a flat triangle along a straight boundary; a split keeps the triangulation whole and Delaunay; samples along straight runs are inserted on the boundary.cargo fmt --check,cargo clippy --all-targets -D warningsand the source rules pass.cargo test --all-targets --no-fail-fast: the same 6 tests fail as onmainon this machine (Windows; wc_subtract, the stored-fixture batch/matrix/tessellation cases, golden scenes, IFC body digest), with identical output. The golden scenes may want re-recording where they were recorded, since curved trimmed faces now mesh differently.Overlap
This branch is off
mainand touchestrimmed_face.rs, as do #37 and #52, so they conflict textually. The fixes are independent; all three are combined on the fork'sintegration/3.0, whose test suite and downstream parts run on that combination. Happy to rebase this on whichever lands first.Files
main/opengeometry/src/tessellation/delaunay.rs(new),mod.rsmain/opengeometry/src/tessellation/trimmed_face.rsmain/opengeometry/src/tessellation/tests/delaunay.rs(new),tests/mod.rs🤖 Generated with Claude Code