[vtkusers] Fwd: vtkDecimatePro not fully working with vtkDouble polydata

Bill Lorensen bill.lorensen at gmail.com
Sat Nov 30 08:15:30 EST 2013


You can set the precision of the output points:

deci->SetOutputPointsPrecision(vtkAlgorithm::DOUBLE_PRECISION);



On Sat, Nov 30, 2013 at 5:11 AM, pof <jd379252 at gmail.com> wrote:

>  No answer yet on this question.
>
> Just to mention this is a problem for me as I'm working on meshes
> expressed in geographical coordinates, i.e. sometimes having large values
> (typically over 1e7) which are unaccurately represented by float variables.
>
> Any idea / comment ?
>
>
> -------- Message original --------  Sujet: vtkDecimatePro not fully
> working with vtkDouble polydata  Date : Wed, 27 Nov 2013 18:58:52 +0100  De :
> pof <jd379252 at gmail.com> <jd379252 at gmail.com>  Pour : vtkusers at vtk.org
>
>
> 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
>
>
>
>
>
> ------------------------------
>    <http://www.avast.com/>
>
> Ce courrier électronique ne contient aucun virus ou logiciel malveillant
> parce que la protection Antivirus avast! <http://www.avast.com/> est
> active.
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131130/b38d763a/attachment.htm>


More information about the vtkusers mailing list