diff --git a/vcg/complex/algorithms/mesh_to_matrix.h b/vcg/complex/algorithms/mesh_to_matrix.h index 780c4af0..dc22ffb9 100644 --- a/vcg/complex/algorithms/mesh_to_matrix.h +++ b/vcg/complex/algorithms/mesh_to_matrix.h @@ -240,11 +240,11 @@ public: tri::RequireCompactness(m); h.resize(m.vn); fill(h.begin(),h.end(),0); - for(FaceIterator fi=m.face.begin(); fi!=m.face.end();++fi) + for (int i = 0; i < m.FN(); ++i) { - ScalarType a = DoubleArea(*fi)/6.0; - for(int j=0;jVN();++j) - h[tri::Index(m,fi->V(j))] += a; + ScalarType a = DoubleArea(m.face[i])/6.0; + for(int j=0;j