From 6bd92a9a1e91b14292f42371ee0231bada4e7c63 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 1 Jul 2005 11:17:06 +0000 Subject: [PATCH] Added option of passing a base mesh to Sphere for spherifying it --- vcg/complex/trimesh/create/platonic.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/vcg/complex/trimesh/create/platonic.h b/vcg/complex/trimesh/create/platonic.h index 1366519e..3faa108b 100644 --- a/vcg/complex/trimesh/create/platonic.h +++ b/vcg/complex/trimesh/create/platonic.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.3 2005/06/17 00:49:29 cignoni +Added missing Sphere function + Revision 1.2 2005/02/25 11:41:08 pietroni Fixed bug in Square @@ -364,22 +367,25 @@ void Square(MeshType &in) (*fi).V(0)=ivp[0]; (*fi).V(1)=ivp[2]; (*fi).V(2)=ivp[3]; } -// this function build a sphere starting from a possibly not empty mesh. -// if the mesh is not empty it is used as base for the subdivision process. +// this function build a sphere starting from a eventually not empty mesh. +// If the mesh is not empty it is 'spherified' and used as base for the subdivision process. // otherwise an icosahedron is used. template void Sphere(MESH_TYPE &in, const int subdiv = 3 ) { if(in.vn==0 && in.fn==0) Icosahedron(in); - //in.ComputeBorderFlag(); + + MESH_TYPE::VertexIterator vi; + for(vi = in.vert.begin(); vi!=in.vert.end();++vi) + vi->P().Normalize(); + tri::UpdateFlags::FaceBorderFromNone(in); int lastsize = 0; for(int i=0;i >(in,MidPoint(),0); - MESH_TYPE::VertexIterator vi; - + for(vi = in.vert.begin()+lastsize;vi!=in.vert.end();++vi) vi->P().Normalize();