Bug fixed in the definition of the PerVertexAttribute "indexInput"
This commit is contained in:
parent
fd2bfa9f64
commit
6cf0410a6f
|
|
@ -57,7 +57,7 @@ private:
|
||||||
// Initialize the convex hull with the biggest tetraedron created using the vertices of the input mesh
|
// Initialize the convex hull with the biggest tetraedron created using the vertices of the input mesh
|
||||||
static void InitConvexHull(InputMesh& mesh, CHMesh& convexHull)
|
static void InitConvexHull(InputMesh& mesh, CHMesh& convexHull)
|
||||||
{
|
{
|
||||||
typename CHMesh:: template PerVertexAttributeHandle<int> indexInputVertex = Allocator<InputMesh>::template GetPerVertexAttribute<int>(mesh, std::string("indexInput"));
|
typename CHMesh:: template PerVertexAttributeHandle<size_t> indexInputVertex = Allocator<InputMesh>::template GetPerVertexAttribute<size_t>(convexHull, std::string("indexInput"));
|
||||||
InputVertexPointer v[3];
|
InputVertexPointer v[3];
|
||||||
//Find the 6 points with min/max coordinate values
|
//Find the 6 points with min/max coordinate values
|
||||||
InputVertexIterator vi = mesh.vert.begin();
|
InputVertexIterator vi = mesh.vert.begin();
|
||||||
|
|
@ -109,7 +109,7 @@ private:
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
(*chVi).P().Import(v[i]->P());
|
(*chVi).P().Import(v[i]->P());
|
||||||
indexInputVertex[chVi] = vcg::tri::Index(mesh, v[i]);
|
indexInputVertex[chVi] = 0;
|
||||||
chVi++;
|
chVi++;
|
||||||
}
|
}
|
||||||
CHFaceIterator fi = vcg::tri::Allocator<CHMesh>::AddFace(convexHull, 0, 1, 2);
|
CHFaceIterator fi = vcg::tri::Allocator<CHMesh>::AddFace(convexHull, 0, 1, 2);
|
||||||
|
|
@ -169,7 +169,7 @@ public:
|
||||||
vcg::tri::RequireFFAdjacency(convexHull);
|
vcg::tri::RequireFFAdjacency(convexHull);
|
||||||
vcg::tri::RequirePerFaceNormal(convexHull);
|
vcg::tri::RequirePerFaceNormal(convexHull);
|
||||||
vcg::tri::Allocator<InputMesh>::CompactVertexVector(mesh);
|
vcg::tri::Allocator<InputMesh>::CompactVertexVector(mesh);
|
||||||
typename CHMesh:: template PerVertexAttributeHandle<int> indexInputVertex = Allocator<InputMesh>::template GetPerVertexAttribute<int>(mesh, std::string("indexInput"));
|
typename CHMesh:: template PerVertexAttributeHandle<size_t> indexInputVertex = Allocator<InputMesh>::template GetPerVertexAttribute<size_t>(convexHull, std::string("indexInput"));
|
||||||
if (mesh.vert.size() < 4)
|
if (mesh.vert.size() < 4)
|
||||||
return false;
|
return false;
|
||||||
InitConvexHull(mesh, convexHull);
|
InitConvexHull(mesh, convexHull);
|
||||||
|
|
@ -322,6 +322,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tri::UpdateTopology<CHMesh>::ClearFaceFace(convexHull);
|
tri::UpdateTopology<CHMesh>::ClearFaceFace(convexHull);
|
||||||
vcg::tri::Allocator<CHMesh>::CompactFaceVector(convexHull);
|
vcg::tri::Allocator<CHMesh>::CompactFaceVector(convexHull);
|
||||||
vcg::tri::Clean<CHMesh>::RemoveUnreferencedVertex(convexHull);
|
vcg::tri::Clean<CHMesh>::RemoveUnreferencedVertex(convexHull);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue