[vtkusers] vtkDecimatePro not fully working with vtkDouble polydata

pof jd379252 at gmail.com
Wed Nov 27 12:58:52 EST 2013


Hi vtk'ers,

I have a mesh with points defined as vtkDouble:
     vtkPoints *MeshPoints = vtkPoints::New(VTK_DOUBLE);
and with a regular vtkCellArray:
     vtkCellArray *MeshCells = vtkCellArray::New();

The mesh is build as usual with:
     vtkPolyData *MeshPolyData;
     MeshPolyData->SetPoints(MeshPoints);
     MeshPolyData->SetPolys(MeshCells);

Now I need to perform a mesh decimation of this mesh, and I'm doing 
nothing special:
     vtkDecimatePro *deci = vtkDecimatePro::New();
     deci->SetInput(MeshPolyData);
     deci->SetTargetReduction(DecimationFactor);
     deci->PreserveTopologyOn();
     deci->BoundaryVertexDeletionOn();
     deci->SetMaximumError(VTK_DOUBLE_MAX);
     deci->Update();

The problem I am facing is that the resulting decimated mesh is actually 
based on vtkFloat:
     int type = deci->GetOutput()->GetPoints()->GetDataType();

i.e. type = 10 (VTK_FLOAT), wheras I would have expected 11 (VTK_DOUBLE) 
as for the original mesh.

I would have though that the data type of the decimated mesh should have 
been the same as the input mesh, which is not the case.
Is this a bug? Or have I missed something?

Thanks in advance for your help/advice.
Pof

---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com



More information about the vtkusers mailing list