[vtkusers] VTKPolyData to 3D image

David Doria daviddoria+vtk at gmail.com
Mon Apr 19 12:54:27 EDT 2010


On Mon, Apr 19, 2010 at 12:39 PM, David Welch <dmwelch at engineering.uiowa.edu
> wrote:

> Thank you!   I'll let you know how it works out.  How can I add this to my
> Paraview setup?
>

Let's keep the discussion on the mailing list so everyone can input and
benefit.

As it was part of a bigger submission (surface reconstruction), I didn't
wrap vtkVoxelizePolyData directly. I just tried to quickly make it into a
Paraview plugin, but it seems I have separated the code a bit differently
than I remember.

vtkVoxelizePolyData simply creates the vtkImageData with reasonable bounds
over the polydata. Computing the distance to the surface was actually done
in vtkPointSetSurfaceReconstrion, and then I used a vtkContourFilter to
extract the 0 level set (the surface). You can definitely reuse most of this
code - you just have to check the sign on the SignedDistanceToPlane function
and mark the point as inside or outside.

You could also ust vtkVoxelizePolyData to make the grid, then use something
like this:
http://www.vtk.org/Wiki/VTK/Examples/PointInsideObject

on every point to do the inside/outside marking.

Good luck,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100419/9a733eb5/attachment.htm>


More information about the vtkusers mailing list