From 0fa9233f78d60d9ef628c3d74dde5944dc0fb93d Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 22 Mar 2020 12:08:38 +1100 Subject: [PATCH] better interpolation of magnitude values when interpolate from vertices to faces --- .../parametrization/tangent_field_operators.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/vcg/complex/algorithms/parametrization/tangent_field_operators.h b/vcg/complex/algorithms/parametrization/tangent_field_operators.h index 28f557f9..85b5a029 100644 --- a/vcg/complex/algorithms/parametrization/tangent_field_operators.h +++ b/vcg/complex/algorithms/parametrization/tangent_field_operators.h @@ -22,6 +22,7 @@ ****************************************************************************/ #include #include +#include #ifndef VCG_TANGENT_FIELD_OPERATORS #define VCG_TANGENT_FIELD_OPERATORS @@ -837,6 +838,7 @@ public: ret=i; } } + assert(ret!=-1); return ret; @@ -1080,13 +1082,13 @@ public: if (fabs(rotatedDir*tF0)>fabs(rotatedDir*tF1)) { - mag1+=fabs(f.V(i)->K1()); - mag2+=fabs(f.V(i)->K2()); + mag1+=(f.V(i)->K1()); + mag2+=(f.V(i)->K2()); } else { - mag1+=fabs(f.V(i)->K2()); - mag2+=fabs(f.V(i)->K1()); + mag1+=(f.V(i)->K2()); + mag2+=(f.V(i)->K1()); } } @@ -1393,7 +1395,13 @@ public: for (size_t i=0;i