diff --git a/vcg/complex/algorithms/parametrization/tangent_field_operators.h b/vcg/complex/algorithms/parametrization/tangent_field_operators.h index caa2004b..abc69580 100644 --- a/vcg/complex/algorithms/parametrization/tangent_field_operators.h +++ b/vcg/complex/algorithms/parametrization/tangent_field_operators.h @@ -562,7 +562,7 @@ public: static int MissMatchByCross(const FaceType &f0, const FaceType &f1) { - CoordType dir0=CrossVector(f0,0); + //CoordType dir0=CrossVector(f0,0); CoordType dir1=CrossVector(f1,0); CoordType dir1Rot=Rotate(f1,f0,dir1); @@ -609,19 +609,40 @@ public: } ///select singular vertices - static void SelectSingularByCross(MeshType &mesh) + static void UpdateSingularByCross(MeshType &mesh) { - for (unsigned int i=0;i Handle_Singular; + typename MeshType::template PerVertexAttributeHandle Handle_SingularIndex; + + if (hasSingular) + Handle_Singular=vcg::tri::Allocator::template GetPerVertexAttribute(mesh,std::string("Singular")); + else + Handle_Singular=vcg::tri::Allocator::template AddPerVertexAttribute(mesh,std::string("Singular")); + + if (hasSingularIndex) + Handle_SingularIndex=vcg::tri::Allocator::template GetPerVertexAttribute(mesh,std::string("SingularIndex")); + else + Handle_SingularIndex=vcg::tri::Allocator::template AddPerVertexAttribute(mesh,std::string("SingularIndex")); + + for (size_t i=0;i