Skip to content
Snippets Groups Projects
Commit 7fe75ff5 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'poissonrecon_fix' into 'master'

fix infinite looping (missed file in last commit)

For some reason this file was missing in my last commit, which contains the actual change to break out of the loop.

See merge request !3
parents 1adaac77 8cfd1f76
No related branches found
No related tags found
1 merge request!3fix infinite looping (missed file in last commit)
......@@ -1237,26 +1237,37 @@ int Octree<Degree>::setTreeMemory( std::vector< Real >& _pts_stream, int maxDept
}
normals = new std::vector< Point3D<Real> >();
unsigned int curPt = 0;
cnt = 0;
// pointStream->reset();
Point3D< Real > p , n;
while ( cnt < _pts_stream.size()/(2*DIMENSION) )
while (curPt < _pts_stream.size()/(2*DIMENSION) )
// while( pointStream->nextPoint( p , n ) )
{
for ( int i = 0; i < DIMENSION; ++i )
{
p[i] = _pts_stream[2*DIMENSION*cnt + i];
n[i] = _pts_stream[2*DIMENSION*cnt + DIMENSION + i];
p[i] = _pts_stream[2*DIMENSION*curPt + i];
n[i] = _pts_stream[2*DIMENSION*curPt + DIMENSION + i];
}
n *= Real(-1.);
p = xForm * p , n = xFormN * n;
p = ( p - _center ) / _scale;
if( !_inBounds(p) ) continue;
if (!_inBounds(p))
{
// skip point
++curPt;
continue;
}
myCenter = Point3D< Real >( Real(0.5) , Real(0.5) , Real(0.5) );
myWidth = Real(1.0);
Real l = Real( Length( n ) );
if( l!=l || l<=EPSILON ) continue;
if (l != l || l <= EPSILON)
{
// skip point
++curPt;
continue;
}
if( !useConfidence ) n /= l;
l = Real(1.);
......@@ -1338,6 +1349,7 @@ int Octree<Degree>::setTreeMemory( std::vector< Real >& _pts_stream, int maxDept
d++;
}
}
curPt++;
cnt++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment