Files
Henry 1786815cb9 Kernel booleans: corners of two parts farther apart than tolerance are no longer fused into one vertex (#16131)
* Booleans: a proto vertex never relates objects farther apart than their tolerance

Two pie slices whose arc centre misses the apex by 4.85e-5 (as SolidCraft
draws them, through the rounded corner points), with walls parted by 3.3e-7
rad: the arc cylinders cross 1.41e-5 from both corners, and the crossing's
ends classify onto A's corner vertex in A and B's in B, each within its own
2e-5 band, while the corners are 2.82e-5 apart.
find_or_create_proto_vertex_pcs related them anyway, with the deviation as
the proto vertex's tolerance, merging the corners: NotSolid. Upstream computes
that deviation in sm_FindPositionFromPCs and only reports it.

Now a pair whose objects lie farther apart than
xsect_tol_3d_from_zones(zone1, zone2) (or a NaN deviation) gets no proto
vertex, as a pair that cannot be imprinted: the two classifications name two
points, and each body keeps its own vertex.

Tests: unit test a_proto_vertex_never_relates_vertices_farther_apart_than_
their_tolerance (vertices 1.5e-5 apart make one, 2.8e-5 apart none; fails
without the change). Integration test pie_slices_with_an_off_centre_arc_and_
parted_walls_touch_along_the_apex (centre +-4.85e-5, walls 3.3e-7 and 1e-6
rad apart: 2 solids, 10/17/10, valid, closed-form volume within 1e-7)
also needs #15830's planar-wall decision (planes_part in
faces_on_other_surfaces): with both it passes; on main without this change
it fails with NotSolid.

Goldens: topology.proto_topology_p3 moves 27 of 3013 cases (blessed), all
random proto scripts calling FindOrCreateProtoVertex on unrelated points; in
each the rule fires once (twice in gen1434) on a deviation 8.6x (gen0882:
203 vs 23.6) to 1e11x the band, or against a band of 0 (zone tolerances 0 in
the script, deviations 9.2e-4 .. 1.4e5). None is near the boundary.
proto_topology_p1/p2, boolean.merge_p1..p5, topology_intersector_p1..p3
unchanged; boolean.api_brep differs only in crossing_creases_union_d1e-05 and
issue1519_bench_tubes_union_measured, identically without this change
(Windows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Booleans: the proto-vertex identity rule is for vertex pairs, measured from the vertices

CI (Linux goldens) failed offset.offset_executive_p2 in 10 rounded outsets of
Boolean/extrudeHoles1.smb (overlap_pc_extrudeHoles1_f{0,2,3,4,5}_k0.3{6,7}_out_rnd).
There the rule refused Edge/Edge pairs whose object points were 18.25 mm apart
against a band of 1.19e-2 (gaps 0): overlapping edges whose parameters
ResolveOverlappingProtoEdges only settles later, so their first points are no
measure of separation. Refusing them broke the outset: in f3_k0.37 the result went
from 1 lump / 44 faces to 2 lumps / 32 faces (vertex bound y -22.85 -> -18.66),
while the r-neighbourhood of a connected face is one connected solid. The rule is
now for Vertex/Vertex pairs only: a vertex's point is fixed, so two vertices
farther apart than xsect_tol_3d_from_zones(zone1, zone2) are two points. With it
offset.offset_executive_p2 is back to main's results (all 594 cases).

The distance is now measured from the two vertices' points instead of
sm_FindPositionFromPCs' deviation, which is 0 when a classification starts
without parameters (CodeRabbit), so such a pair was never refused. The deviation
keeps upstream's meaning for the tolerances it feeds (VertexDefinition,
CreateVertexDefinition, CreateProtoVertex, the FIND_POS golden). New unit test
vertices_without_parameters_are_measured_before_they_are_related (fails with the
deviation-based gate).

Goldens: topology.proto_topology_p3 now moves 5 of 3013 cases against main
instead of 27 (the 22 others were non-vertex refusals and are back to main's
values): gen0753 (vertices 7.93 apart, band 0), gen0779 (7.6e-4, band 1e-9),
gen1197 (10.0, band 2e-9), gen1354 (9.7e-4, band 1.36e-5, 71x), gen2296 (10.0,
band 1.02e-4). All 283 units run with and without the rule on Windows: only
proto_topology_p3 differs (the Windows platform diffs of main are identical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:15:45 +00:00
..