[vtkusers] Constrained Delaunay, poly edges on the external boundary

Mr Beko Dur bekirst at yahoo.com
Fri Feb 3 07:41:37 EST 2006


Hello everyone,

I have a problem with constrained delaunay
triangulation. 
The triangulation is failing, when at least one of the
constraints on the boundary and constraints  allocated
to more than one cell.

In below, i have added a sample TCL code. when you
comment out the lines in the constraints and points
definition you can see the problem.

What might be the cause and how can i resolve this
issue? (i am using 4.2)

Thank you.

Bekir Turkmen


package require vtk
package require vtkinteraction
package require vtktesting

# Generate the input points and constrained
edges/polygons.
#
vtkPoints points
points InsertPoint 0 0.0 0.0 6
points InsertPoint 1 10.0 0.0 6
points InsertPoint 2 10.0 5.0 6
points InsertPoint 3 0.0 5.0 6
points InsertPoint 4 1.0 0.0 6
points InsertPoint 5 3.0 0.0 6
points InsertPoint 6 3.0 1.0 6
points InsertPoint 7 1.0 1.0 6

#points InsertPoint 8 7.0 1.0 6
#points InsertPoint 9 9.0 1.0 6
#points InsertPoint 10 9.0 2.0 6
#points InsertPoint 11 7.0 2.0 6


vtkCellArray polys
polys InsertNextCell 4
polys InsertCellPoint 0
polys InsertCellPoint 1
polys InsertCellPoint 2
polys InsertCellPoint 3

polys InsertNextCell 4
polys InsertCellPoint 7
polys InsertCellPoint 6
polys InsertCellPoint 5
polys InsertCellPoint 4


#polys InsertNextCell 4
#polys InsertCellPoint 11
#polys InsertCellPoint 10
#polys InsertCellPoint 9
#polys InsertCellPoint 8




vtkPolyData polyData
    polyData SetPoints points
    polyData SetPolys polys

vtkDelaunay2D del
    del SetInput polyData
    del SetSource polyData
vtkPolyDataMapper mapMesh
    mapMesh SetInput [del GetOutput]
vtkActor meshActor
    meshActor SetMapper mapMesh
    eval [meshActor GetProperty] SetColor $peacock

# Create graphics objects
# Create the rendering window, renderer, and
interactive renderer
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

# Add the actors to the renderer, set the background
and size
ren1 AddActor meshActor
#ren1 AddActor edgeActor
ren1 SetBackground 0 0 0
renWin SetSize 450 300

# render the image
#
iren AddObserver UserEvent {wm deiconify .vtkInteract}
[ren1 GetActiveCamera] Zoom 2
iren Initialize

# prevent the tk window from showing up then start the
event loop
wm withdraw .

 


 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the vtkusers mailing list