[vtkusers] building polygonal Polydata from line Polydata

David E. Jones jonesde at rainbow.es.dupont.com
Thu Jun 22 14:39:15 EDT 2000


Chris Myers wrote:

> David,
>
> Thanks for your suggestion (I hadn't thought of it), but I don't think
> it's quite right for what I need.  vtkDelaunay2D will generate a
> triangulation of the vertex points.  But since I have cut a set of
> arbitrary polyhedra, the cells in my 2D cut plane are not just
> triangles; they are polygons with an arbitrary number of sides.
>
> Chris
>
> On Thu, 22 Jun 2000, David E. Jones wrote:
>
> > Date: Thu, 22 Jun 2000 12:38:43 -0400
> > From: "David E. Jones" <jonesde at rainbow.es.dupont.com>
> > To: Chris Myers <myers at TC.Cornell.EDU>
> > Subject: Re: [vtkusers] building polygonal Polydata from line Polydata
> >
> > 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
> >

 Chris,

  I misunderstood your problem.   I think this will work but I've never tried it:

  Represent each convex polyhedron as the intersection of half planes.  I think
  you can do this with several vtkPlane objects combined with vtkImplicitBoolean.
  This makes a new compound implicit function.  Then use the compound implicit
  function to cut a large rectangle made with vtkPlaneSource using vtkClipPolyData.
  This will give you one of the polygons you want.  Then repeat this process for
  each convex polyhedron.

  I hope this helps in some way.  I'm interested in this type of thing because I
  have an application which will require calculating intersections and differences
  of non-convex shapes.

  There is another approximate approach which I think will also work even for
  non-convex objects:   Use  vtkImplicitModeller to calculate a volume of distances
  from the surfaces (i.e. polygons) of all your convex polyhedra.   Then cut a large
  rectangle made with vtkPlaneSource using vtkClipPolyData and an implicit function
  made from the distance volume using vtkImplicitVolume.  You can  make this as
  accurate as you want by making the distance volume high resolution.

  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://public.kitware.com/pipermail/vtkusers/attachments/20000622/95cdbc61/attachment.html>


More information about the vtkusers mailing list