[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43413] branches/carve_booleans/extern/ carve/lib/csg_collector.cpp: Carve booleans: Respect classification against both closed and open meshes
Sergey Sharybin
sergey.vfx at gmail.com
Mon Jan 16 08:34:16 CET 2012
Revision: 43413
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43413
Author: nazgul
Date: 2012-01-16 07:34:15 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
Carve booleans: Respect classification against both closed and open meshes
Modified Paths:
--------------
branches/carve_booleans/extern/carve/lib/csg_collector.cpp
Modified: branches/carve_booleans/extern/carve/lib/csg_collector.cpp
===================================================================
--- branches/carve_booleans/extern/carve/lib/csg_collector.cpp 2012-01-16 07:32:38 UTC (rev 43412)
+++ branches/carve_booleans/extern/carve/lib/csg_collector.cpp 2012-01-16 07:34:15 UTC (rev 43413)
@@ -119,22 +119,33 @@
}
FaceClass fc = FACE_UNCLASSIFIED;
+
+ unsigned fc_closed_bits = 0;
+ unsigned fc_open_bits = 0;
unsigned fc_bits = 0;
for (std::list<ClassificationInfo>::const_iterator i = grp->classification.begin(), e = grp->classification.end(); i != e; ++i) {
if ((*i).intersected_mesh == NULL) {
// classifier only returns global info
- fc_bits = class_to_class_bit((*i).classification);
+ fc_closed_bits = class_to_class_bit((*i).classification);
break;
}
+ if ((*i).classification == FACE_UNCLASSIFIED) continue;
if ((*i).intersectedMeshIsClosed()) {
- if ((*i).classification == FACE_UNCLASSIFIED) continue;
- fc_bits |= class_to_class_bit((*i).classification);
+ fc_closed_bits |= class_to_class_bit((*i).classification);
+ } else {
+ fc_open_bits |= class_to_class_bit((*i).classification);
}
}
+ if (fc_closed_bits) {
+ fc_bits = fc_closed_bits;
+ } else {
+ fc_bits = fc_open_bits;
+ }
+
fc = class_bit_to_class(fc_bits);
// handle the complex cases where a group is classified differently with respect to two or more closed manifolds.
More information about the Bf-blender-cvs
mailing list