[vtkusers] Checking on whether or not a bug in vtkTriangleFilter has been fixed...

John Biddiscombe j.biddiscombe at rl.ac.uk
Tue Jul 11 05:48:59 EDT 2000


Renny,

>The points listed should give an "H-shape" polygon.  If you map them out on
>paper that is what you will get.  This doesn't seem to happen when you try
>to do it through vtk, however.

I've had similar problems, although I've not tried the routines for a
while. Currently my software does this...

Take the points which define the original polygon (H shaped or whatever).
Triangulate them using Delaunay2D 
Take the centroid of each final triangle and do a point in polygon test on
the original polygon
Keep the good ones, reject the bad.
Build a final triangle mesh from the results.

I did this mainly because all the code already existed from a previous
implementation (pre vtk) and all I had to do was change a call to
"triangulate" to a vtk based delaunay, and rewrite a few polygon tests etc.
Speed of operation was not critical - just as long as the answers came out
in a usable form.

I found that the triangulation routine in vtkPolygon was
a) recursive and for polygons with hundreds of points was seriously hitting
memory (as you say 750MB was not unusual - well I mean unusual in the sense
that it happened to me too, but really 750MB is quite unusual isn't it?)
b) Failed on some complex shapes like H's etc etc

I should have tried to fix/improve the triangulate routines (and for all I
know they are working fine now), but just didn't have time to look through
all the relevant code. It's a problem.

ttfn

John B





More information about the vtkusers mailing list