[Bf-blender-cvs] [6f47552] bmesh-boolean-experiment: BMesh boolean no longer splits geometry

Campbell Barton noreply at git.blender.org
Sat Nov 28 04:08:54 CET 2015


Commit: 6f475521e4242bf0674b12e6363ef06c65c97be2
Author: Campbell Barton
Date:   Sat Nov 28 14:00:28 2015 +1100
Branches: bmesh-boolean-experiment
https://developer.blender.org/rB6f475521e4242bf0674b12e6363ef06c65c97be2

BMesh boolean no longer splits geometry

Duplicate geometry was created along intersections.

===================================================================

M	source/blender/bmesh/tools/bmesh_intersect.c
M	source/blender/modifiers/intern/MOD_boolean.c

===================================================================

diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c
index b867053..6437835 100644
--- a/source/blender/bmesh/tools/bmesh_intersect.c
+++ b/source/blender/bmesh/tools/bmesh_intersect.c
@@ -481,6 +481,22 @@ static BMVert *bm_isect_edge_tri(
 	return NULL;
 }
 
+static bool bm_loop_filter_fn(const BMLoop *l, void *UNUSED(user_data))
+{
+	if (l->radial_next != l) {
+		BMLoop *l_iter = l->radial_next;
+		const char hflag_test = BM_ELEM_DRAW;  /* XXX, set in MOD_boolean.c */
+		const char hflag = BM_elem_flag_test(l->f, hflag_test);
+		do {
+			if (BM_elem_flag_test(l_iter->f, hflag_test) != hflag) {
+				return false;
+			}
+		} while ((l_iter = l_iter->radial_next) != l);
+		return true;
+	}
+	return false;
+}
+
 /**
  * Return true if we have any intersections.
  */
@@ -1570,7 +1586,7 @@ bool BM_mesh_intersect(
 		groups_array = MEM_mallocN(sizeof(*groups_array) * (size_t)bm->totface, __func__);
 		group_tot = BM_mesh_calc_face_groups(
 		        bm, groups_array, &group_index,
-		        NULL, NULL,
+		        bm_loop_filter_fn, NULL,
 		        0, BM_EDGE);
 
 #ifdef USE_DUMP
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index db795c9..fb47ab1 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -247,7 +247,7 @@ static DerivedMesh *applyModifier(
 				        bm,
 				        looptris, tottri,
 				        bm_face_isect_pair, NULL,
-				        false, true, false,
+				        false, false, false,
 				        bmd->operation,
 				        bmd->threshold);




More information about the Bf-blender-cvs mailing list