From 1d79254dbc66f08a7882de74836cc34482486dc1 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 13 Nov 2014 22:50:39 +0000 Subject: [PATCH] Added PerVertexArea and PerFaceArea to collect vectors of areas from a mesh --- vcg/complex/algorithms/mesh_to_matrix.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vcg/complex/algorithms/mesh_to_matrix.h b/vcg/complex/algorithms/mesh_to_matrix.h index 95d8af7a..bc6dd64e 100644 --- a/vcg/complex/algorithms/mesh_to_matrix.h +++ b/vcg/complex/algorithms/mesh_to_matrix.h @@ -220,6 +220,29 @@ public: return ret; } + template< class VecType > + static void PerVertexArea(MeshType &m, VecType &h) + { + tri::RequireCompactness(m); + h.resize(m.vn); + for(int i=0;iVN();++j) + h[tri::Index(m,fi->V(j))] += a; + } + } + + template< class VecType > + static void PerFaceArea(MeshType &m, VecType &h) + { + tri::RequireCompactness(m); + h.resize(m.fn); + for(int i=0;i > &index,