From 5e03df37b769f0689fb82926df945592e849e589 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni Date: Mon, 5 Dec 2016 13:04:47 +0100 Subject: [PATCH] Corrected bug in the BuildMeshFromCoordVectorIndexVector And improved comment on usage --- vcg/complex/algorithms/create/platonic.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vcg/complex/algorithms/create/platonic.h b/vcg/complex/algorithms/create/platonic.h index ef509320..c6ab95d0 100644 --- a/vcg/complex/algorithms/create/platonic.h +++ b/vcg/complex/algorithms/create/platonic.h @@ -689,10 +689,14 @@ void SuperEllipsoid(MeshType &m, float rFeature, float sFeature, float tFeature, tri::Clean::OrientCoherentlyMesh(m,oriented,orientable); tri::UpdateSelection::Clear(m); } -// this function build a mesh starting from a vector of generic coords (objects having a triple of float at their beginning) -// and a vector of faces (objects having a triple of ints at theri beginning). -template -void BuildMeshFromCoordVectorIndexVector( MeshType & in, const V & v, const F & f) + +/** This function build a mesh starting from a vector of generic coords (InCoordType) and indexes (InFaceIndexType) + * InCoordsType needs to have a [] access method for accessing the three coordinates + * and similarly the InFaceIndexType requires [] access method for accessing the three indexes + */ + +template +void BuildMeshFromCoordVectorIndexVector(MeshType & in, const std::vector & v, const std::vector & f) { typedef typename MeshType::CoordType CoordType; typedef typename MeshType::VertexPointer VertexPointer; @@ -704,7 +708,7 @@ void BuildMeshFromCoordVectorIndexVector( MeshType & in, const V & v, const F & for(size_t i=0;i=0 ); assert( ff[1]>=0 ); assert( ff[2]>=0 );