[vtkusers] New vtkPolyDataToImageStencil

David Gobbi david.gobbi at gmail.com
Wed Feb 20 16:13:12 EST 2008

After several years of saying that I would, I have finally replaced
the old vtkPolyDataToImageStencil code with a new, better algorithm.

The "old" version used an OBB tree to sort out which points were
inside or outside of the polydata.  It was flakey on two counts.
First, if the polydata did not form a continous, closed surface, then
it would often fail depending on how the openings in the polydata were
oriented.  Second, because it was sensitive to roundoff error,
sometimes it would fail even for a properly closed surface.

The "new" version uses the vtkCutter code to slice the polydata
surface into polygons, and then rasterizes each polygon into the
vtkStencilData.  It also fills the gaps in the polygons if the surface
is not closed.  It should be much more robust and much faster than the
old code.

If anyone has had trouble with vtkPolyDataToImageStencil in the past,
please try getting the new version from CVS and let me know how it
works for you.


More information about the vtkusers mailing list