[vtk-developers] Bug in vtkExtractPolyDataGeometry

Nicolas Rannou nicolas_rannou at hms.harvard.edu
Wed Jun 2 20:43:11 EDT 2010


Hello,

We found a bug in "vtkExtractPolyDataGeometry" and we would like to 
correct it as soon as possible since we need this file for our application.
We use vtkExtractPolyDataGeometry to extract one cell from a polydata.
But it appears that sometimes, the cell of interest is not extracted but 
only the points composing this cell (no line extracted..!).
The original polydata and the implicit function have the same dimensions 
(2D) and the issue appears when we try to do a "parallel extraction": 
extract a cell, from a 2D polydata, with a 2D implicit function. Both 
data and implicit function are in the same plane (xy) and are at the same z.
So it should always work.
__________________________________________

   extracter->SetInput( dataset );
   extracter->SetImplicitFunction( this->SliceImplicitPlane );
   extracter->Update();
__________________________________________

The issue could be that:
-one test (at least) is too strict and doesn't succeed even if it should

line: 186 in vtkExtractPolyDataGeometry.cxx

         if ( newScalars->GetValue(pts[i]) <= 0.0 )
           {
           numIn++;
           }

OR


-there are issues during the conversion to obtain the values.
line: 116 in vtkExtractPolyDataGeometry.cxx

   for (int ptId=0; ptId < numPts; ptId++ )
     {
     newScalars->SetValue(ptId, this->ImplicitFunction->
                          FunctionValue(inPts->GetPoint(ptId))*multiplier);
     }


In my case,  0 < newScalars < 0.000005.
If I change the condition to
  if ( newScalars->GetValue(pts[i]) <= 1.e-05){...}
, the extraction works properly.

Please find enclosed the informations about the ImplicitFunction used 
and the polydata in a case which doesn't work.

Thanks,

Note that there is the same behaviour with vtkClipPolydata but we didn't 
try to solve this one but we assume the issue is the same.

________________________________________

vtkPolyData (0x7b71050)
   Debug: Off
   Modified Time: 3488397
   Reference Count: 5
   Registered Events: (none)
   Source: (none)
   Information: 0x7c2eb10
   Data Released: False
   Global Release Data: Off
   UpdateTime: 3488755
   Release Data: Off
   UpdateExtent: Not Initialized
   Update Number Of Pieces: 1
   Update Piece: 0
   Update Ghost Level: 0
   MaximumNumberOfPieces: -1
   RequestExactExtent: On
    Field Data:
     Debug: Off
     Modified Time: 3488384
     Reference Count: 1
     Registered Events: (none)
     Number Of Arrays: 0
     Number Of Components: 0
     Number Of Tuples: 0
   Number Of Points: 111
   Number Of Cells: 1
   Cell Data:
     Debug: Off
     Modified Time: 3488395
     Reference Count: 1
     Registered Events: (none)
     Number Of Arrays: 0
     Number Of Components: 0
     Number Of Tuples: 0
     Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
     Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
     Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
     Scalars: (none)
     Vectors: (none)
     Normals: (none)
     TCoords: (none)
     Tensors: (none)
     GlobalIds: (none)
     PedigreeIds: (none)
     EdgeFlag: (none)
   Point Data:
     Debug: Off
     Modified Time: 3488397
     Reference Count: 1
     Registered Events: (none)
     Number Of Arrays: 0
     Number Of Components: 0
     Number Of Tuples: 0
     Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
     Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
     Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
     Scalars: (none)
     Vectors: (none)
     Normals: (none)
     TCoords: (none)
     Tensors: (none)
     GlobalIds: (none)
     PedigreeIds: (none)
     EdgeFlag: (none)
   Bounds:
     Xmin,Xmax: (104.4, 104.4)
     Ymin,Ymax: (80.671, 143.189)
     Zmin,Zmax: (9.99767, 50.8094)
   Compute Time: 3488651
   Number Of Points: 111
   Point Coordinates: 0x37073b0
   Locator: 0
   Number Of Vertices: 0
   Number Of Lines: 1
   Number Of Polygons: 0
   Number Of Triangle Strips: 0
   Number Of Pieces: 1
   Piece: 0
   Ghost Level: 0
____________________________________________

vtkPlane (0x39ae6d0)
   Debug: Off
   Modified Time: 3466238
   Reference Count: 17
   Registered Events: (none)
   Transform: (None)
   Normal: (1, 0, 0)
   Origin: (104.4, 104.4, 522)




More information about the vtk-developers mailing list