From 1ba15f1f7f94616d52e8bbd80e22c9e34e45a81e Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Sun, 7 Mar 2021 18:13:19 -0500 Subject: Speedup for usual non-manifold exact boolean case. The commit rB6f63417b500d that made exact boolean work on meshes with holes (like Suzanne) unfortunately dramatically slowed things down on other non-manifold meshes that don't have holes and didn't need the per-triangle insideness test. This adds a hole_tolerant parameter, false by default, that the user can enable to get good results on non-manifold meshes with holes. Using false for this parameter speeds up the time from 90 seconds to 10 seconds on an example with 1.2M triangles. --- source/blender/editors/mesh/editmesh_intersect.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_intersect.c') diff --git a/source/blender/editors/mesh/editmesh_intersect.c b/source/blender/editors/mesh/editmesh_intersect.c index b269a4f0514..0e3cc22d358 100644 --- a/source/blender/editors/mesh/editmesh_intersect.c +++ b/source/blender/editors/mesh/editmesh_intersect.c @@ -212,6 +212,7 @@ static int edbm_intersect_exec(bContext *C, wmOperator *op) nshapes, use_self, use_separate_all, + false, true); } else { @@ -375,8 +376,16 @@ static int edbm_intersect_boolean_exec(bContext *C, wmOperator *op) } if (use_exact) { - has_isect = BM_mesh_boolean( - em->bm, em->looptris, em->tottri, test_fn, NULL, 2, use_self, true, boolean_operation); + has_isect = BM_mesh_boolean(em->bm, + em->looptris, + em->tottri, + test_fn, + NULL, + 2, + use_self, + true, + false, + boolean_operation); } else { has_isect = BM_mesh_intersect(em->bm, -- cgit v1.2.3