Skip to content

Merge #105: Fix boolean seams at slivers and near-parallel faces - #125

Merged
wrong-nebula merged 4 commits into
mainfrom
fix/sliver-boolean-pr105
Dec 4, 2026
Merged

wrong-nebula merged 4 commits into
mainfrom
fix/sliver-boolean-pr105

Conversation

@wrong-nebula

Copy link
Copy Markdown
Owner

Merges #105 by @pnooyen (organization fork prevents pushing conflict resolution directly to the PR branch). Preserves original commit a3a1eaf and full authorship.

Conflict resolution in crates/forma-core/src/boolean.rs:

  • Kept main's packed-u64 collect_bad_edges_and_verts and paired interior-edge guard in eliminate_t_junctions
  • Kept fix(core): close boolean seams at slivers and near-parallel faces #105's needle-triangle point_in_tri_3d segment-distance check, 1e-6 coplanar normal threshold in classify_point_vs_mesh, unit test, and crates/forma-core/tests/boolean_seams.rs (4 stress tests)

Verified with cargo test --locked --release -p forma-core -p forma-lang (all passing, including 4/4 boolean_seams, 24/24 issue_regressions, 18/18 audit_regressions).

Closes #104

pnooyen and others added 4 commits December 4, 2026 02:37
Two independent ways a boolean of two closed solids came out open:

- eliminate_t_junctions split any edge that passed within seg_tol of a
  boundary vertex, including edges already closed by two faces. When a
  face is a fan with a sliver thinner than seg_tol (e.g. a board face
  after one drilled hole), the next cut's seam vertices sit within
  seg_tol of both long edges of the sliver, and the face beyond it split
  its closed edge too: overlapping fragments, non-manifold edges. The
  perturbation retries cannot help since the sliver is in operand A.
  Only open (boundary or non-manifold) edges are split now.

- classify_point_vs_mesh treated a fragment as coplanar with an opposing
  triangle at |n.n'| > 1 - 1e-5, but subdivide_tri_local treats a pair as
  coplanar only at > 1 - 1e-6 and otherwise cuts it along the crossing
  line. For nearly parallel pairs in between (two faceted rounds of the
  same radius), fragments within 1e-5 of the other plane were called
  coplanar and the rest classified by winding, so each side switched at
  a different fragment and open strips were left. The classifier uses
  the splitter's threshold now.

Adds tests/boolean_seams.rs: two holes drilled in a line, seeded chains
of 24 holes into one and into four faces of a board (each step closed,
volume exact), and round prisms with different facet counts
intersected.
Each edge test in point_in_tri_3d is the edge length times the point's
signed distance inside that edge, and it was compared against a fixed
-1e-7. Past a short edge that admits points far outside the triangle:
for an edge 1e-4 long (normalized), points up to 1e-3 beyond it. Faces
next to sliver triangles were then classified CoplanarSame/Opp with
triangles they do not touch. Scale each edge's tolerance by its length
so it is a distance of 1e-7 for every edge.
…orner

A point outside a triangle counted as on it when it was within 1e-7 of
each edge's line. Past a needle triangle's sharp corner both long edges'
lines stay within 1e-7 of each other for far longer than the needle (at
3.5e-5 rad, millimetres), so a coplanar face beside it was split into a
sliver past the corner and classified coplanar with the needle. Two boxes
that only touch side by side then reported a small shared volume.

Now a point outside is on the triangle only within 1e-7 of one of its
edges (the segment, after projecting onto the triangle's plane).
# Conflicts:
#	crates/forma-core/src/boolean.rs
@wrong-nebula
wrong-nebula merged commit f6cbcec into main Dec 4, 2026
3 checks passed
@wrong-nebula
wrong-nebula deleted the fix/sliver-boolean-pr105 branch December 4, 2026 05:17
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.

Boolean leaves open or non-manifold solids: holes drilled one after another, and faceted rounds intersected

2 participants