[vtkusers] vtkCleanPolyData bug : setTolerance to 0.0 can make vtkCleanPolyData hang with some type of data

Sebastien MARAUX maraux at ondim.fr
Fri Jan 10 10:08:29 EST 2003


Hello,

I don't understand why vtkCleanPolyData
hangs while I provide a valid  vtkPolyData pointer
as input.

I use the same code for different dataset.
I verify that vtkPolyData is not null before cleaning,
and it still hangs for a specific range of polydata size.
Below this range, clean is OK, beyond this range, it cleans
without hanging too.

If I comment setTolerance (0.0) things run smoothly.
I would expect the same result with SetTolerance (0.0)
(i.e. the default)

I would let you know about that, do not set tolerance
to 0.0, because it can make vtkCleanPolyData bug.
For a loop / setting tolerance from variable value :
instead, make a test tol. != 0.0 before setting tolerance

my hanging  function (mp_PolyData != NULL, can get # of points,
etc.) :

/*-------------------------------------------------------------------------*
/
void SIGFilter::Clean()
{
 if (mp_PolyData !=NULL)
 {
  cout <<"Cleaning" <<endl;

  cout <<"mp_Polydata # of points : " <<mp_PolyData->GetNumberOfPoints()
<<endl;
  vtkCleanPolyData *cleaner=vtkCleanPolyData::New();
  cleaner->DebugOn();
  cleaner->SetInput(mp_PolyData);
  cleaner->SetTolerance(0.0);
  cleaner->Update();

  mp_PolyData->SetPoints(cleaner->GetOutput()->GetPoints());
  mp_PolyData->DeepCopy(cleaner->GetOutput());

  cleaner->Delete();
 }
 else
 {
  cerr <<"Warning : trying to clean mp_PolyData with null polydata" <<endl;
 }
}

/*-------------------------------------------------------------------------*
/

Any body have an idea of what is wrong with vtkCleanPolyData ?

Thank you

S. MARAUX





More information about the vtkusers mailing list