diff --git a/vcg/complex/algorithms/parametrization/tangent_field_operators.h b/vcg/complex/algorithms/parametrization/tangent_field_operators.h index 2365da8d..a6650270 100644 --- a/vcg/complex/algorithms/parametrization/tangent_field_operators.h +++ b/vcg/complex/algorithms/parametrization/tangent_field_operators.h @@ -444,15 +444,15 @@ private: CoordType bary0,bary1; bool Inside0=vcg::InterpolationParameters(T0Rot,Interpolated,bary0); bool Inside1=vcg::InterpolationParameters(T1Rot,Interpolated,bary1); - //assert(Inside0 || Inside1); - if (!(Inside0 || Inside1)) - { - std::cout << "Not Inside " << Interpolated.X() << "," << Interpolated.Y() << "," << Interpolated.Z() << std::endl; - std::cout << "bary0 " << bary0.X() << "," << bary0.Y() << "," << bary0.Z() << std::endl; - std::cout << "bary1 " << bary1.X() << "," << bary1.Y() << "," << bary1.Z() << std::endl; - std::cout << "Diff0 " << fabs(bary0.Norm() - 1) << std::endl; - std::cout << "Diff1 " << fabs(bary1.Norm() - 1) << std::endl; - } + assert(Inside0 || Inside1); +// if (!(Inside0 || Inside1)) +// { +// std::cout << "Not Inside " << Interpolated.X() << "," << Interpolated.Y() << "," << Interpolated.Z() << std::endl; +// std::cout << "bary0 " << bary0.X() << "," << bary0.Y() << "," << bary0.Z() << std::endl; +// std::cout << "bary1 " << bary1.X() << "," << bary1.Y() << "," << bary1.Z() << std::endl; +// std::cout << "Diff0 " << fabs(bary0.Norm() - 1) << std::endl; +// std::cout << "Diff1 " << fabs(bary1.Norm() - 1) << std::endl; +// } if (Inside0) { @@ -504,6 +504,8 @@ private: std::vector SwapF(faces.begin(),faces.end()); directions.clear(); + faces.clear(); + for (size_t i=0;ibest) + { + best=dot; + ret=i; + } + } + assert(ret!=-1); + + return ret; + } + static int FollowDirection(const FaceType &f0, const FaceType &f1, int dir0)