Repository navigation
Share face boundary splits so meshes stay watertight (ENG-3826) - #28
Merged
akhilles merged 2 commits intoOct 11, 2026
Conversation
refine_boundary splits a face's boundary segment where its own chart needs it, and only that face got the new point. The other face on the edge kept the segment whole, so every such split was a T-junction. pcb welds a model's vertices before meshopt simplification, and those open seams kept it from simplifying smooth surfaces split into faces. Splits now use the midpoint (a + b) / 2, which is the same point for both faces. After a shell's faces are meshed, each face also splits the boundary edges that other faces split, at the same midpoint, by fanning the one triangle on that edge in two. The midpoint lies on the edge, so the face's surface and error do not change, and no face is meshed twice. The checked-in closed solids are now watertight: every edge borders two triangles.
The shared-split pass hashes every boundary edge of every face, and the refinement loop hashes each triangle's edges several times per pass. Their keys are indices and exact float bits, so they need no keyed hash. A multiply-rotate hasher replaces SipHash in those maps and in the crossing-edge vertex map. Output is unchanged. Sharing splits adds about 3% to tessellation time on the board corpus, mostly in the fan triangles it adds; this pays it back.
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.


Adjacent faces now split a shared boundary edge at the same midpoint, so the tessellated mesh has no T-junctions on shared edges and pcb can weld and simplify across smooth seams. On the 1,004-model board corpus, pcb's simplified output has 14.6% fewer triangles and 13.8% fewer GLB buffer bytes, with 0 failed faces and no change in the error bound. The summed tessellation time stays the same because a second commit removes SipHash from the hot edge maps. Fixes ENG-3826.