Corrected small bug in compacting arrays after a torus creation. Also faces must be compacted...

This commit is contained in:
Paolo Cignoni 2015-07-12 10:44:55 +00:00
parent 1dc8a067ac
commit 06040acbb0
1 changed files with 2 additions and 2 deletions

View File

@ -603,7 +603,7 @@ void Torus(MeshType &m, float hRingRadius, float vRingRadius, int hRingDiv=24, i
}
FaceGrid(m,vRingDiv+1,hRingDiv+1);
tri::Clean<MeshType>::RemoveDuplicateVertex(m);
tri::Allocator<MeshType>::CompactVertexVector(m);
tri::Allocator<MeshType>::CompactEveryVector(m);
}
@ -764,7 +764,7 @@ void FaceGrid(MeshType & in, int w, int h)
template <class MeshType>
void FaceGrid(MeshType & in, const std::vector<int> &grid, int w, int h)
{
assert(in.vn == (int)in.vert.size()); // require a compact vertex vector
tri::RequireCompactness(in);
assert(in.vn <= w*h); // the number of vertices should match the number of expected grid vertices
// V0 V1