[vtkusers] building polygonal Polydata from line Polydata

David E. Jones jonesde at rainbow.es.dupont.com
Thu Jun 22 12:38:43 EDT 2000


Chris Myers wrote:

> 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

  Can't you rotate the points so that the normal to the plane they lie in (which is
  the normal to the cutting plane) is parallel to the z axis and then use vtkDelaunay2D
  to triangulate the points using just the x,y coordinates of the points?  Then you could
rotate
  the triangles/points back to the original orientation.

 Dave

--
David E Jones
Du Pont Central Research
Experimental Station, Bldg 320
Wilmington, DE 19880-0320


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20000622/86a02c62/attachment.htm>


More information about the vtkusers mailing list