diff --git a/vcg/complex/algorithms/isotropic_remeshing.h b/vcg/complex/algorithms/isotropic_remeshing.h index 9985e4ed..6d79897a 100644 --- a/vcg/complex/algorithms/isotropic_remeshing.h +++ b/vcg/complex/algorithms/isotropic_remeshing.h @@ -437,10 +437,10 @@ private: assert(ff.size() > 0); - const Point3 & fNormal = NormalizedTriangleNormal(**it); + const Point3 fNormal = NormalizedTriangleNormal(**(ff.begin())); - const auto tot = std::accumulate(++ff.begin(), ff.end(), 0.d, [&](const ScalarType acc, const FaceType * f) { - return acc + (1 - math::Abs(fastAngle(n, NormalizedTriangleNormal(*f)))); + const auto tot = std::accumulate(++ff.begin(), ff.end(), 0., [&](const ScalarType acc, const FaceType * f) { + return acc + (1 - math::Abs(fastAngle(fNormal, NormalizedTriangleNormal(*f)))); }); vi->Q() = tot / (std::max(1, ((int)ff.size()-1)));