diff --git a/src/GeometryUtils.cc b/src/GeometryUtils.cc index b9c452fa..babb5968 100644 --- a/src/GeometryUtils.cc +++ b/src/GeometryUtils.cc @@ -63,6 +63,7 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons, int numContours = 0; std::vector contour; + std::vector vflags(polygons.vertices.size()); // Inits with 0's BOOST_FOREACH(const IndexedFace &face, polygons.faces) { const Vector3f *verts = &polygons.vertices.front(); contour.clear(); @@ -71,6 +72,7 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons, contour.push_back(v[0]); contour.push_back(v[1]); contour.push_back(v[2]); + vflags[idx]++; } assert(face.size() >= 3); PRINTDB("Contour: %d\n", face.size()); @@ -101,8 +103,8 @@ bool GeometryUtils::tessellatePolygonWithHoles(const IndexedPolygons &polygons, B) Locate all unused vertices C) For each unused vertex, create a triangle connecting it to the existing mesh */ - int numInputVerts = polygons.faces[0].size(); - std::vector vflags(numInputVerts); // Init 0 + const IndexedFace &face = polygons.faces.front(); + int inputSize = face.size(); IndexedTriangle tri; for (int t=0;t