[vtkusers] How to do a simple constrained delaunay

Janko Jerinic janko.jerinic at gmail.com
Thu Jun 8 04:47:08 EDT 2006


Hi,

I'm having trouble making a simple constrained Delaunay work. Let's say I
have a set of points and a single line
connecting two of those points (or a couple of lines, or open polylines)
that I use for constraint. Now I make
a vtkPoints object, fill it up with points, I make a vtkCellArray, and if I
want to add just one line I'd go:

CellArray->InsertNextCell(2); and CellArray->InsertNextPoint(id1),
->InsertNextPoint(id2), right? Right.

Now, I make a vtkPolyData, call setPoints with vtkPoints and setPolys with
vtkCellArray and set it up
with a vtkDelaunay2D, as in the example constrainedDelaunay.py/.tcl, with
SetInput and SetSource.
That doesn't work for some reason, there are as many triangles as there are
constraining lines, at
least one provided. If no constraints are applied, the triangulation works
perfectly. What's the deal?

Now I've noticed that, in the example, which works fine, there are 40 points
and all of these points are
used for constraints (there are two polyline constraints, one of 12 and one
of 28 points)! Ok, so
the first 12 points make the outer rectangle, and the rest form the letters
"vtk". So, what must be done
in order for CDT to work? Must all the points be included in the
constraining lines/polylines? I mean,
constrained Delaunay is supposed to work over an arbitrary set of points and
a set of lines connecting
these points which should remain in the triangulation.

Anyone had any experiences with that?
Please help,
Janko Jerinic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060608/3a93743e/attachment.htm>


More information about the vtkusers mailing list