[vtkusers] Reading points from a file for Delaunay's triangulation

Pedro Correa Hernandez pedrock at hotmail.com
Thu Feb 14 20:28:47 EST 2002


Hi, I have some problems to import a set of 3D points from a file to 
triangulate them. For instance in the file Delaunay3D.tcl, instead of using 
points created randomly I would need to read the points from a file 
containing them (whichever the format).
Here is the file Delaunay3D, with the part of random creation that should be 
replaced.
Thanks

Pedro

# create some random points in the unit cube centered at (.5,.5,.5)
#
vtkMath math
vtkPoints points
for {set i 0} {$i<25} {incr i 1} {
    eval points InsertPoint $i [math Random 0 1] [math Random 0 1] [math 
Random 0 1]
}

vtkPolyData profile
    profile SetPoints points

# triangulate them
#
vtkDelaunay3D del
    del SetInput profile
    del BoundingTriangulationOn
    del SetTolerance 0.01
    del SetAlpha 0.2
    del BoundingTriangulationOff




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.




More information about the vtkusers mailing list