From 7fcc5800aef8f6355730ef27eb70f49f0480a42a Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Sat, 10 Jun 2006 15:47:19 +0000 Subject: ===Tools=== Adding back some code to booleans that got lost in the Orange merge. I've also added back the code which checked that meshes were solid ("manifolds") but have the actual check in intern/boolop/intern/BOP_Interface.cpp, since from my testing it was not causing crashes or hangs. It *can* give odd results depending on what you're trying to intersect, but seems useful. Additionally, since existing bugs in the current code can create non-solid/non-manifold meshes, seems hypocritical to create a mesh that can't later be used in another boolean operation. --- intern/bsp/intern/CSG_BooleanOps.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'intern/bsp') diff --git a/intern/bsp/intern/CSG_BooleanOps.cpp b/intern/bsp/intern/CSG_BooleanOps.cpp index a0b4dc0078d..1a3a149adeb 100755 --- a/intern/bsp/intern/CSG_BooleanOps.cpp +++ b/intern/bsp/intern/CSG_BooleanOps.cpp @@ -118,8 +118,6 @@ CSG_PerformBooleanOperation( BSP_MeshInfo * mesh_info = static_cast(operation->CSG_info); if (mesh_info == NULL) return 0; - bool success = 1; - obAFaces.Reset(obAFaces.it); obBFaces.Reset(obBFaces.it); obAVertices.Reset(obAVertices.it); @@ -139,8 +137,9 @@ CSG_PerformBooleanOperation( break; } + BoolOpState boolOpResult; try { - BOP_performBooleanOperation( boolType, + boolOpResult = BOP_performBooleanOperation( boolType, mesh_info->output_descriptor, (BSP_CSGMesh**) &(mesh_info->output_mesh), mesh_info->obB_descriptor, @@ -155,7 +154,12 @@ CSG_PerformBooleanOperation( return 0; } - return success; + switch (boolOpResult) { + case BOP_OK: return 1; + case BOP_NO_SOLID: return -2; + case BOP_ERROR: return 0; + default: return 1; + } } int -- cgit v1.2.3