[Paraview] Bad triangulation for Polygon

Moreland, Kenneth kmorel at sandia.gov
Tue Oct 2 12:20:17 EDT 2007


ParaView is doing the Delaunay triangulation correct.  The problem is
that the Delaunay triangulation is not what you are looking for.  The
Delaunay triangulation looks only at a collection of points (so that
your line border is thrown away) and provides a triangulation with many
interesting properties, on of which is that it is the convex hull of the
points.  Since your original polygon is not convex, the Delaunay
triangulation of its points will not cover the same area.

 

Part of your problem is that you are trying to represent a polygon as a
line.  ParaView/VTK will not recognize this as a 2D polygon with area
and thus will not try to triangulate it as such.  Instead, load the
polygon as an actual polygon.  In your data file, change LINES on line
23 to POLYGONS.  (You can also remove the last point in the polygon if
you want.  It is redundant as the polygon will automatically be closed.)
Now load that into ParaView.  You will notice that it is not rendered
correctly.  That is simply because the rendering algorithms assume that
it is rendering convex polygons.  Don't worry; the underlying
representation is still correct.

 

Now that ParaView/VTK correctly understands that this is a polygon, you
can run the "Triangulate" filter on it.  That gives you a correct
(although not optimal) triangulation.

 

-Ken

 

________________________________

From: paraview-bounces+kmorel=sandia.gov at paraview.org
[mailto:paraview-bounces+kmorel=sandia.gov at paraview.org] On Behalf Of
Bob Anderson
Sent: Tuesday, October 02, 2007 9:50 AM
To: paraview at paraview.org
Subject: [Paraview] Bad triangulation for Polygon

 

For polygons with lobes, the tests I've done with ParaView don't give
correct surface triangulation.

In the case where the object comes from my custom reader, using
output->SetPolys(myCellsPtr); it produces a surface that doesn't stay
within the polygon boundary, and applying the Delaunay2D filter to the
polyline object (SamplePolygon1Cell.vtk) also 'blobbs' the polygon.

See attachments -a correct surface triangulation
(SamplePolySurface.jpg), and the ParaView result
(PV_Delaunay2D_Polygon.jpg)

I'm currently doing my own triangulation using 'hgrd_src' routines from
CodeProject, but if there is a better way to get the correct results
within ParaView I'd be happy to try it.

 

Bob Anderson

MIRARCO Mining Innovation

Laurentian University

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20071002/812bcab8/attachment.htm


More information about the ParaView mailing list