changed the strategy to find point to fix in an automatic way, and some minor changes in comments

This commit is contained in:
Nico Pietroni 2013-02-19 13:53:33 +00:00
parent 8111bcda24
commit 1f91e92f9a
1 changed files with 729 additions and 712 deletions

View File

@ -26,6 +26,8 @@
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#include <eigenlib/Eigen/Sparse> #include <eigenlib/Eigen/Sparse>
//#include <eigenlib/Eigen/SparseCore>
//#include <eigenlib/Eigen/SparseCholesky>
#include <eigenlib/unsupported/Eigen/SparseExtra> #include <eigenlib/unsupported/Eigen/SparseExtra>
#include <time.h> #include <time.h>
@ -34,6 +36,7 @@
#include <vcg/complex/algorithms/update/flag.h> #include <vcg/complex/algorithms/update/flag.h>
#include <vcg/complex/algorithms/update/bounding.h> #include <vcg/complex/algorithms/update/bounding.h>
#include <vcg/complex/algorithms/parametrization/distortion.h> #include <vcg/complex/algorithms/parametrization/distortion.h>
#include <vcg/complex/algorithms/parametrization/uv_utils.h>
namespace vcg { namespace vcg {
namespace tri{ namespace tri{
@ -158,7 +161,13 @@ class PoissonSolver
if (vt1->IsD())continue; if (vt1->IsD())continue;
if (!vt0->IsB())continue; if (!vt0->IsB())continue;
if (!vt1->IsB())continue; if (!vt1->IsB())continue;
ScalarType d_test=(vt0->P()-vt1->P()).Norm(); // ScalarType d_test=(vt0->P()-vt1->P()).Norm();
ScalarType Dx=fabs(vt0->P().X()-vt1->P().X());
ScalarType Dy=fabs(vt0->P().Y()-vt1->P().Y());
ScalarType Dz=fabs(vt0->P().Z()-vt1->P().Z());
// ScalarType d_test=std::max(Dx,std::max(Dy,Dz));
ScalarType d_test=std::max(fabs(Dx-Dy),std::max(fabs(Dx-Dz),fabs(Dy-Dz)));
if (d_test>dmax) if (d_test>dmax)
{ {
dmax=d_test; dmax=d_test;
@ -586,12 +595,20 @@ public:
{ {
tri::UpdateTopology<MeshType>::FaceFace(mesh); tri::UpdateTopology<MeshType>::FaceFace(mesh);
int NNmanifoldE=tri::Clean<MeshType>::CountNonManifoldEdgeFF(mesh); int NNmanifoldE=tri::Clean<MeshType>::CountNonManifoldEdgeFF(mesh);
if (NNmanifoldE!=0)return false; if (NNmanifoldE!=0)
{
printf("Non Manifold");
return false;
}
/*int NNmanifoldV=tri::Clean<MeshType>::CountNonManifoldVertexFF(mesh); /*int NNmanifoldV=tri::Clean<MeshType>::CountNonManifoldVertexFF(mesh);
if (NNmanifoldV!=0)return false;*/ if (NNmanifoldV!=0)return false;*/
int G=tri::Clean<MeshType>::MeshGenus(mesh); int G=tri::Clean<MeshType>::MeshGenus(mesh);
int numholes=tri::Clean<MeshType>::CountHoles(mesh); int numholes=tri::Clean<MeshType>::CountHoles(mesh);
if (numholes==0) return false; if (numholes==0)
{
printf("Non omeomorph to a disc");
return false;
}
return (G==0); return (G==0);
} }