mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
Corrected Cleaning for poisson (removal of vertexes with bad normals)
This commit is contained in:
parent
e56641bc59
commit
ec6129c9fd
@ -555,11 +555,15 @@ void PoissonClean(MeshType &m, bool scaleNormal, bool cleanFlag)
|
||||
vcg::tri::UpdateNormal<MeshType>::NormalizePerVertex(m);
|
||||
|
||||
if(cleanFlag) {
|
||||
for (auto vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
||||
if (vcg::SquaredNorm(vi->N()) < std::numeric_limits<float>::min()*10.0)
|
||||
vi->setD();
|
||||
for (auto vi = m.vert.begin(); vi != m.vert.end(); ++vi)
|
||||
if (vcg::SquaredNorm(vi->N()) < std::numeric_limits<float>::min()*10.0)
|
||||
vcg::tri::Allocator<MeshType>::DeleteVertex(m,*vi);
|
||||
|
||||
for (auto fi = m.face.begin(); fi != m.face.end(); ++fi)
|
||||
if( fi->V(0)->IsD() || fi->V(1)->IsD() || fi->V(2)->IsD() )
|
||||
vcg::tri::Allocator<MeshType>::DeleteFace(m,*fi);
|
||||
}
|
||||
|
||||
|
||||
vcg::tri::Allocator<MeshType>::CompactEveryVector(m);
|
||||
if(scaleNormal)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user