diff --git a/vcg/complex/algorithms/polygonal_algorithms.h b/vcg/complex/algorithms/polygonal_algorithms.h index 6fcc2416..8c2f8b5b 100644 --- a/vcg/complex/algorithms/polygonal_algorithms.h +++ b/vcg/complex/algorithms/polygonal_algorithms.h @@ -30,6 +30,8 @@ #include #include +#include + //define a temporary triangle mesh type class TempFace; class TempVertex; @@ -169,8 +171,7 @@ private: static bool CollapseBorderSmallEdgesStep(PolyMeshType &poly_m, - const ScalarType edge_limit, - ScalarType angleDeg=100) + const ScalarType edge_limit) { //update topology vcg::tri::UpdateTopology::FaceFace(poly_m); @@ -356,11 +357,19 @@ public: vcg::GetPolyTemplatePos(f,TemplatePos,true); CoordType NormT=Normal(TemplatePos); + //get the normal of vertices - CoordType AVN(0,0,0); + //CoordType AVN(0,0,0); + //CoordType AVN0(0,0,0); CoordType Origin(0,0,0); - for (int j=0;jN(); +// for (int j=0;jN(); + + CoordType AVN=vcg::PolygonNormal(f); + //AVN0.Normalize(); +// std::cout<<"AVN "< avgPos(poly_m.vert.size(),CoordType(0,0,0)); std::vector weightSum(poly_m.vert.size(),0); //then compute the templated positions + for (size_t i=0;i TemplatePos; @@ -416,8 +428,7 @@ public: ScalarType val=vcg::PolyArea(poly_m.face[i]); if (val<(AvgArea*0.00001)) val=(AvgArea*0.00001); - ScalarType W=1.0/val;//poly_m.face[i].Q(); - //ScalarType W=1; + ScalarType W=1.0/val; for (size_t j=0;j1)alpha=1; // if (isnan(alpha))alpha=1; CoordType newP=avgPos[i]/weightSum[i]; + //std::cout<<"W "< SumAngle(poly_m.face.size(),0); -// for (size_t i=0;iQ()+=AreaF * CurrAngle/SumAngle[i]; -// } -// } -// } - static void InitQualityVertVoronoiArea(PolyMeshType &poly_m) { for (size_t i=0;i