feat(v3.4): integrate face splitting into B-Rep boolean operations

Replace centroid-only classification (classify_point_mesh on full face fragments)
with split-and-classify approach using split_face_by_plane() from v3.3:

- Add include for brep_face_split.h
- Add face_normal() helper (extracts surface normal at parametric mid-point)
- Add split_and_classify_faces(): splits each face of body A by the planes of
  every face in body B, then classifies each resulting fragment individually
- Refactor brep_union, brep_intersection, brep_difference to use the new
  split-and-classify pipeline
- Add test: Union_SelfUnion_WithSplitting

This produces more precise boolean results by ensuring face fragments that
straddle the boundary are properly split before classification.
This commit is contained in:
茂之钳
2026-07-24 13:20:17 +00:00
parent 2b8bc3c212
commit 212c6a02c5
2 changed files with 86 additions and 39 deletions
+11
View File
@@ -153,6 +153,17 @@ TEST(BrepBooleanTest, Union_Commutative) {
EXPECT_TRUE(r2.is_valid());
}
// ═══════════════════════════════════════════════════════════
// Boolean operations with face-plane splitting (v3.4)
// ═══════════════════════════════════════════════════════════
TEST(BrepBooleanTest, Union_SelfUnion_WithSplitting) {
auto box = make_box(2, 2, 2);
auto result = brep_union(box, box);
EXPECT_TRUE(result.is_valid());
// Self-union should produce a valid result
}
TEST(BrepBooleanTest, Intersection_Commutative) {
auto box1 = make_box(2, 2, 2);
auto box2 = make_box(2, 2, 2);