better interpolation of magnitude values when interpolate from vertices to faces

This commit is contained in:
nico 2020-03-22 12:08:38 +11:00
parent f7ed8fd13d
commit 0fa9233f78
1 changed files with 13 additions and 5 deletions

View File

@ -22,6 +22,7 @@
****************************************************************************/ ****************************************************************************/
#include <vcg/math/histogram.h> #include <vcg/math/histogram.h>
#include <vcg/complex/algorithms/update/curvature.h> #include <vcg/complex/algorithms/update/curvature.h>
#include <wrap/io_trimesh/export.h>
#ifndef VCG_TANGENT_FIELD_OPERATORS #ifndef VCG_TANGENT_FIELD_OPERATORS
#define VCG_TANGENT_FIELD_OPERATORS #define VCG_TANGENT_FIELD_OPERATORS
@ -837,6 +838,7 @@ public:
ret=i; ret=i;
} }
} }
assert(ret!=-1); assert(ret!=-1);
return ret; return ret;
@ -1080,13 +1082,13 @@ public:
if (fabs(rotatedDir*tF0)>fabs(rotatedDir*tF1)) if (fabs(rotatedDir*tF0)>fabs(rotatedDir*tF1))
{ {
mag1+=fabs(f.V(i)->K1()); mag1+=(f.V(i)->K1());
mag2+=fabs(f.V(i)->K2()); mag2+=(f.V(i)->K2());
} }
else else
{ {
mag1+=fabs(f.V(i)->K2()); mag1+=(f.V(i)->K2());
mag2+=fabs(f.V(i)->K1()); mag2+=(f.V(i)->K1());
} }
} }
@ -1393,7 +1395,13 @@ public:
for (size_t i=0;i<mesh.vert.size();i++) for (size_t i=0;i<mesh.vert.size();i++)
{ {
if (mesh.vert[i].IsD())continue; if (mesh.vert[i].IsD())continue;
//if (mesh.vert[i].IsB())continue;
if (mesh.vert[i].IsB())
{
Handle_Singular[i]=false;
Handle_SingularIndex[i]=0;
continue;
}
int missmatch; int missmatch;
if (IsSingularByCross(mesh.vert[i],missmatch)) if (IsSingularByCross(mesh.vert[i],missmatch))