[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43307] branches/carve_booleans: Carve booleans: fix for own error when handling meshed with several islands

Sergey Sharybin sergey.vfx at gmail.com
Wed Jan 11 19:26:47 CET 2012


Revision: 43307
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43307
Author:   nazgul
Date:     2012-01-11 18:26:47 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
Carve booleans: fix for own error when handling meshed with several islands

Modified Paths:
--------------
    branches/carve_booleans/extern/carve/include/carve/mesh.hpp
    branches/carve_booleans/extern/carve/patches/series
    branches/carve_booleans/intern/boolop/intern/BOP_CarveInterface.cpp

Added Paths:
-----------
    branches/carve_booleans/extern/carve/patches/mesh_iterator.patch

Modified: branches/carve_booleans/extern/carve/include/carve/mesh.hpp
===================================================================
--- branches/carve_booleans/extern/carve/include/carve/mesh.hpp	2012-01-11 18:24:22 UTC (rev 43306)
+++ branches/carve_booleans/extern/carve/include/carve/mesh.hpp	2012-01-11 18:26:47 UTC (rev 43307)
@@ -719,13 +719,13 @@
         void rev(size_t n);
         void adv(int n);
 
-        FaceIter operator++(int) { FaceIter tmp = *this; fwd(1); return tmp; }
-        FaceIter operator+(int v) { FaceIter tmp = *this; adv(v); return tmp; }
+        FaceIter operator++(int) { FaceIter tmp = *this; tmp.fwd(1); return tmp; }
+        FaceIter operator+(int v) { FaceIter tmp = *this; tmp.adv(v); return tmp; }
         FaceIter &operator++() { fwd(1); return *this; }
         FaceIter &operator+=(int v) { adv(v); return *this; }
 
-        FaceIter operator--(int) { FaceIter tmp = *this; rev(1); return tmp; }
-        FaceIter operator-(int v) { FaceIter tmp = *this; adv(-v); return tmp; }
+        FaceIter operator--(int) { FaceIter tmp = *this; tmp.rev(1); return tmp; }
+        FaceIter operator-(int v) { FaceIter tmp = *this; tmp.adv(-v); return tmp; }
         FaceIter &operator--() { rev(1); return *this; }
         FaceIter &operator-=(int v) { adv(-v); return *this; }
 

Added: branches/carve_booleans/extern/carve/patches/mesh_iterator.patch
===================================================================
--- branches/carve_booleans/extern/carve/patches/mesh_iterator.patch	                        (rev 0)
+++ branches/carve_booleans/extern/carve/patches/mesh_iterator.patch	2012-01-11 18:26:47 UTC (rev 43307)
@@ -0,0 +1,21 @@
+diff -r c8cbec41cd35 include/carve/mesh.hpp
+--- a/include/carve/mesh.hpp	Thu Dec 01 15:51:44 2011 -0500
++++ b/include/carve/mesh.hpp	Thu Jan 12 00:19:58 2012 +0600
+@@ -719,13 +719,13 @@
+         void rev(size_t n);
+         void adv(int n);
+ 
+-        FaceIter operator++(int) { FaceIter tmp = *this; fwd(1); return tmp; }
+-        FaceIter operator+(int v) { FaceIter tmp = *this; adv(v); return tmp; }
++        FaceIter operator++(int) { FaceIter tmp = *this; tmp.fwd(1); return tmp; }
++        FaceIter operator+(int v) { FaceIter tmp = *this; tmp.adv(v); return tmp; }
+         FaceIter &operator++() { fwd(1); return *this; }
+         FaceIter &operator+=(int v) { adv(v); return *this; }
+ 
+-        FaceIter operator--(int) { FaceIter tmp = *this; rev(1); return tmp; }
+-        FaceIter operator-(int v) { FaceIter tmp = *this; adv(-v); return tmp; }
++        FaceIter operator--(int) { FaceIter tmp = *this; tmp.rev(1); return tmp; }
++        FaceIter operator-(int v) { FaceIter tmp = *this; tmp.adv(-v); return tmp; }
+         FaceIter &operator--() { rev(1); return *this; }
+         FaceIter &operator-=(int v) { adv(-v); return *this; }
+ 

Modified: branches/carve_booleans/extern/carve/patches/series
===================================================================
--- branches/carve_booleans/extern/carve/patches/series	2012-01-11 18:24:22 UTC (rev 43306)
+++ branches/carve_booleans/extern/carve/patches/series	2012-01-11 18:26:47 UTC (rev 43307)
@@ -2,3 +2,4 @@
 includes.patch
 win32.patch
 msvc.patch
+mesh_iterator.patch

Modified: branches/carve_booleans/intern/boolop/intern/BOP_CarveInterface.cpp
===================================================================
--- branches/carve_booleans/intern/boolop/intern/BOP_CarveInterface.cpp	2012-01-11 18:24:22 UTC (rev 43306)
+++ branches/carve_booleans/intern/boolop/intern/BOP_CarveInterface.cpp	2012-01-11 18:26:47 UTC (rev 43307)
@@ -225,7 +225,6 @@
 		ofaces[oface_num.getAttribute(f)].push_back(i);
 		carve::mesh::MeshSet<3>::face_t::edge_iter_t edge_iter = f->begin();
 		for (; edge_iter != f->end(); ++edge_iter) {
-			//int index = ofacevert_num.getAttribute(f, edge_iter.idx());
 			int index = vertexToIndex_map[edge_iter->vert];
 			vi[index].push_back(i);
 		}
@@ -234,7 +233,6 @@
 	uint quadverts[4] = {0, 0, 0, 0};
 	// go over each set of faces which belong to an original face
 	std::vector< std::vector<uint> >::const_iterator fii;
-	carve::mesh::MeshSet<3>::mesh_t *mesh = poly->meshes.at(0);
 	uint orig = 0;
 	for (fii=ofaces.begin(); fii!=ofaces.end(); ++fii, ++orig) {
 		std::vector<uint> fl = *fii;
@@ -244,7 +242,7 @@
 			uint findex = fl.back();
 			fl.pop_back();
 
-			carve::mesh::MeshSet<3>::face_t *f = mesh->faces.at(findex);
+			carve::mesh::MeshSet<3>::face_t *f = *(poly->faceBegin() + findex);
 
 			// add all information except vertices to the output mesh
 			outputMesh->FaceSet().push_back(BSP_MFace());
@@ -268,7 +266,7 @@
 					if (findex == otherf)
 						continue;
 
-					carve::mesh::MeshSet<3>::face_t *f2 = mesh->faces.at(otherf);
+					carve::mesh::MeshSet<3>::face_t *f2 = *(poly->faceBegin() + otherf);
 
 					// if other face doesn't have the same original face,
 					// ignore it also



More information about the Bf-blender-cvs mailing list