Fix T38637: Boolean produces faces with holes which isn't supported by BMesh
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 18 Feb 2014 05:51:36 +0000 (11:51 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 18 Feb 2014 05:53:04 +0000 (11:53 +0600)
Simple fix -- use CarveHoleResolver hook for CSG which will split faces
containing holes.

extern/carve/carve-capi.cc

index aaf5761516c9ce56a9f2bb9c88bdb889ed071c37..ed46d196d72ca07a7c208f57bbe62c17f6c69fe2 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <carve/interpolator.hpp>
 #include <carve/rescale.hpp>
+#include <carve/csg_triangulator.hpp>
 
 using carve::mesh::MeshSet;
 
@@ -348,6 +349,9 @@ bool carve_performBooleanOperation(CarveMeshDescr *left_mesh,
 
                carve::csg::CSG csg;
 
+               csg.hooks.registerHook(new carve::csg::CarveHoleResolver,
+                                      carve::csg::CSG::Hooks::PROCESS_OUTPUT_FACE_BIT);
+
                output_descr->orig_vert_mapping.installHooks(csg);
                output_descr->orig_face_edge_mapping.installHooks(csg);
                output_descr->orig_face_mapping.installHooks(csg);