Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-14 13:43:35 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-14 13:43:35 +0400
commitb5f08e60be669b1d5974ff1153855915e0d74593 (patch)
tree6c15ffd5120f52c1ec7e1d65a8a4926d5bcf663e /intern/boolop
parent6905d0d92b7f2faf0d9d26a17f495a663908ec69 (diff)
Carve: improved handling of meshes with interesting manifolds
Unioning of intersecting manifold tried to perform as little union operations as possible, but there were some not totally correct assumption which lead to cases when unioning of manifolds of some mesh might be happened when one of mesh sets already had got intersecting manifolds. This commit corrects this incorrect behavior. Discovered this when was looking into #30175: Boolean Difference causes 2.62 RC1 crash.
Diffstat (limited to 'intern/boolop')
-rw-r--r--intern/boolop/intern/BOP_CarveInterface.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/boolop/intern/BOP_CarveInterface.cpp b/intern/boolop/intern/BOP_CarveInterface.cpp
index 4f566edfe08..3e0daf83ef6 100644
--- a/intern/boolop/intern/BOP_CarveInterface.cpp
+++ b/intern/boolop/intern/BOP_CarveInterface.cpp
@@ -43,6 +43,9 @@ using namespace carve::mesh;
using namespace carve::geom;
typedef unsigned int uint;
+static void Carve_unionIntersections(MeshSet<3> **left_r, MeshSet<3> **right_r,
+ carve::interpolate::FaceAttr<uint> &oface_num);
+
#define MAX(x,y) ((x)>(y)?(x):(y))
#define MIN(x,y) ((x)<(y)?(x):(y))
@@ -276,6 +279,10 @@ static MeshSet<3> *Carve_unionIntersectingMeshes(MeshSet<3> *poly,
left = right;
}
else {
+ /* there might be intersections between manifolds of one operand and another mesh which isn't
+ * taking into accound in Carve_getIntersectedOperand because of optimization purposes */
+ Carve_unionIntersections(&left, &right, oface_num);
+
MeshSet<3> *result = csg.compute(left, right, carve::csg::CSG::UNION, NULL, carve::csg::CSG::CLASSIFY_EDGE);
delete left;