Skip to content

Share face boundary splits so meshes stay watertight (ENG-3826) - #28

Merged
akhilles merged 2 commits into
masterfrom
akhil/eng-3826-foxtrot-share-face-boundary-points-so-meshes-stay-watertight
Oct 11, 2026
Merged

akhilles merged 2 commits into
masterfrom
akhil/eng-3826-foxtrot-share-face-boundary-points-so-meshes-stay-watertight

Conversation

@akhilles

Copy link
Copy Markdown

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.

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a non-blocking comment. This is a functional tessellation change, not a small fixup, so it still needs human review. Cursor Security Agent completed with no findings, Cursor Bugbot was not running, and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@akhilles
akhilles merged commit 0a3dfb1 into master Oct 11, 2026
4 checks passed
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