[vtkusers] building polygonal Polydata from line Polydata

Chris Myers myers at tc.cornell.edu
Thu Jun 22 11:49:50 EDT 2000


I am working with a polyhedral dataset in 3D (from a Voronoi tesselation).
Since I cannot explicitly represent the polyhedra in VTK (i.e., there is
no ConvexPolyhedron cell type, unless I want to build it myself),
I am representing the polygonal facets of the polyhedra as vtkPolyData.

If I cut this Polydata (with a vtkCutter, using a simple cutting
plane), I get a new PolyData instance that lies in the cut plane; this
new Polydata is essentially a set of polygons.  But, because I have
represented my polyhedral set by the polygonal facets rather than 
the polyhedral cells, the output of the vtkCutter is a collection of
lines, rather than a collection of polygons.  (The output is still a
vtkPolyData instance, but all the data are defined as Lines in the
PolyData rather than as Polys.)

I would like to be able to convert this vtkPolyData instance, consisting
a lines connecting vertices, to the equivalent vtkPolyData, consisting
of polygons connecting the vertices.  I could obvously build this up myself
by examining all the Lines in the vtkPolyData, but was hoping that there
might be some sort of filter in VTK that already would accomplish that.

If anyone knows of a convenient way of reorganizing this PolyData,
I'd appreciate hearing about it.

(Also, if anyone has developed any better strategies for dealing with
arbitrary convex polyhedra in VTK, I'd like to hear about those too.)

Thanks,

Chris

==========================================================================
Chris Myers 
Cornell Theory Center
--------------------------------------------------------------------------
636 Rhodes Hall              email: myers at tc.cornell.edu
Cornell University           phone: (607) 255-5894 / fax: (607) 254-8888
Ithaca, NY 14853             http://www.tc.cornell.edu/~myers
--------------------------------------------------------------------------
"To thine own self be blue." - Polonious Funk
==========================================================================








More information about the vtkusers mailing list