From 9c85a5621463ed00d305014bb2a2bb41fa8e8ee9 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Mon, 8 Dec 2014 15:12:29 +0000 Subject: [PATCH] changed IsSingularByCross.. added OrientDirectionFaceCoherently --- .../parametrization/tangent_field_operators.h | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/vcg/complex/algorithms/parametrization/tangent_field_operators.h b/vcg/complex/algorithms/parametrization/tangent_field_operators.h index abc69580..ec586e46 100644 --- a/vcg/complex/algorithms/parametrization/tangent_field_operators.h +++ b/vcg/complex/algorithms/parametrization/tangent_field_operators.h @@ -581,6 +581,34 @@ public: } +// ///return true if a given vertex is singular, +// ///return also the missmatch +// static bool IsSingularByCross(const VertexType &v,int &missmatch) +// { +// typedef typename VertexType::FaceType FaceType; +// ///check that is on border.. +// if (v.IsB())return false; + +// std::vector > posVec; +// //SortedFaces(v,faces); +// face::Pos pos(v.cVFp(), v.cVFi()); +// vcg::face::VFOrderedStarFF(pos, posVec); + +// missmatch=0; +// for (unsigned int i=0;i pos(v.cVFp(), v.cVFi()); vcg::face::VFOrderedStarFF(pos, posVec); - missmatch=0; + int curr_dir=0; for (unsigned int i=0;iPD2().Normalize(); } + static void OrientDirectionFaceCoherently(MeshType &mesh) + { + for (size_t i=0;iIsD())continue; + CoordType Ntest=mesh.face[i].PD1()^mesh.face[i].PD2(); + if ((Ntest*vcg::Normal(f->P(0),f->P(1),f->P(2)))<0)mesh.face[i].PD2()=-mesh.face[i].PD2(); + } + } + static void MakeDirectionFaceCoherent(MeshType &mesh, bool normal_diff=true) {