<HTML>
Chris Myers wrote:
<BLOCKQUOTE TYPE=CITE>David,
<P>Thanks for your suggestion (I hadn't thought of it), but I don't think
<BR>it's quite right for what I need. vtkDelaunay2D will generate
a
<BR>triangulation of the vertex points. But since I have cut a set
of
<BR>arbitrary polyhedra, the cells in my 2D cut plane are not just
<BR>triangles; they are polygons with an arbitrary number of sides.
<P>Chris
<P>On Thu, 22 Jun 2000, David E. Jones wrote:
<P>> Date: Thu, 22 Jun 2000 12:38:43 -0400
<BR>> From: "David E. Jones" <jonesde@rainbow.es.dupont.com>
<BR>> To: Chris Myers <myers@TC.Cornell.EDU>
<BR>> Subject: Re: [vtkusers] building polygonal Polydata from line Polydata
<BR>>
<BR>> Chris Myers wrote:
<BR>>
<BR>> > I am working with a polyhedral dataset in 3D (from a Voronoi tesselation).
<BR>> > Since I cannot explicitly represent the polyhedra in VTK (i.e.,
there is
<BR>> > no ConvexPolyhedron cell type, unless I want to build it myself),
<BR>> > I am representing the polygonal facets of the polyhedra as vtkPolyData.
<BR>> >
<BR>> > If I cut this Polydata (with a vtkCutter, using a simple cutting
<BR>> > plane), I get a new PolyData instance that lies in the cut plane;
this
<BR>> > new Polydata is essentially a set of polygons. But, because
I have
<BR>> > represented my polyhedral set by the polygonal facets rather than
<BR>> > the polyhedral cells, the output of the vtkCutter is a collection
of
<BR>> > lines, rather than a collection of polygons. (The output
is still a
<BR>> > vtkPolyData instance, but all the data are defined as Lines in
the
<BR>> > PolyData rather than as Polys.)
<BR>> >
<BR>> > I would like to be able to convert this vtkPolyData instance, consisting
<BR>> > a lines connecting vertices, to the equivalent vtkPolyData, consisting
<BR>> > of polygons connecting the vertices. I could obvously build
this up myself
<BR>> > by examining all the Lines in the vtkPolyData, but was hoping that
there
<BR>> > might be some sort of filter in VTK that already would accomplish
that.
<BR>> >
<BR>> > If anyone knows of a convenient way of reorganizing this PolyData,
<BR>> > I'd appreciate hearing about it.
<BR>> >
<BR>> > (Also, if anyone has developed any better strategies for dealing
with
<BR>> > arbitrary convex polyhedra in VTK, I'd like to hear about those
too.)
<BR>> >
<BR>> > Thanks,
<BR>> >
<BR>> > Chris
<BR>>
<BR>> Can't you rotate the points so that the normal to the
plane they lie in (which is
<BR>> the normal to the cutting plane) is parallel to the z
axis and then use vtkDelaunay2D
<BR>> to triangulate the points using just the x,y coordinates
of the points? Then you could
<BR>> rotate
<BR>> the triangles/points back to the original orientation.
<BR>>
<BR>> Dave
<BR>>
<BR>> --
<BR>> David E Jones
<BR>> Du Pont Central Research
<BR>> Experimental Station, Bldg 320
<BR>> Wilmington, DE 19880-0320
<BR>></BLOCKQUOTE>
Chris,
<P> I misunderstood your problem. I think this will work
but I've never tried it:
<P> Represent each convex polyhedron as the intersection of half
planes. I think
<BR> you can do this with several vtkPlane objects combined with
vtkImplicitBoolean.
<BR> This makes a new compound implicit function. Then use
the compound implicit
<BR> function to cut a large rectangle made with vtkPlaneSource using
vtkClipPolyData.
<BR> This will give you one of the polygons you want. Then
repeat this process for
<BR> each convex polyhedron.
<P> I hope this helps in some way. I'm interested in this type
of thing because I
<BR> have an application which will require calculating intersections
and differences
<BR> of non-convex shapes.
<P> There is another approximate approach which I think will also
work even for
<BR> non-convex objects: Use vtkImplicitModeller
to calculate a volume of distances
<BR> from the surfaces (i.e. polygons) of all your convex polyhedra.
Then cut a large
<BR> rectangle made with vtkPlaneSource using vtkClipPolyData and
an implicit function
<BR> made from the distance volume using vtkImplicitVolume.
You can make this as
<BR> accurate as you want by making the distance volume high resolution.
<P> Dave
<PRE>--
David E Jones
Du Pont Central Research
Experimental Station, Bldg 320
Wilmington, DE 19880-0320</PRE>
</HTML>