A brief description of the Delaunay algorithm follows. The points to be triangulated are surrounded by six "outside" points that form a strictly bounding octahedron. Then the points to be triangulated are inserted into the triangulation one at a time using the Delaunay property (i.e., the circumsphere of the four points defining a tetrahedron do not contain any other points of the triangulation). This procedure continues iteratively until all points are inserted into the triangulation. At this point, all tetrahedron connected to the "outside" points are deleted, leaving a 3D triangulation of the convex hull of the points. Hence if the initial points set is in a plane or along a line, then no tetrahedron will remain after tetrahedron deletion.
Source points may also be used to control the triangulation. Source points are points marked "outside" (like the "out" points above) and are also introduced into the triangulation. These points are used during the tetrahedron deletion process to further eliminate tetrahedron. In this way it is possible to generate non-convex triangulations.
Normally only tetrahedron are created by triangulation algorithms. Triangles or lines can be generated by creating only those thast use the points not marked "outside". Hence it is possible to use this object to create 2D or 1D triangulations as well.
used.
data_in? get the name of the input data.
source= name set the name of the source object.
source? get the name of the source object.
tetrahedra! generate tetrahedron elements as output of the generate_data! method (default).
triangles! generate triangle elements as output of the generate_data! method.
lines! generate line elements as output of the generate_data! method.
generate_data! create the output data set (in data_out) from the input data set (in data_in).
/* * Generate 1000 random points (using x**2 + y**2 + z**2 = 1) and triangulate */ scalar new: no_pts = 1000;
scalar new: x; scalar new: y; scalar new: z;
unstructured_point_set new: ups ; visage_scalar new: s ; visage_vector new: v ;
scalar new: rand;
loop new: l resolution=1 duration=no_pts start_actions=` logic new: test; ' tick_actions=` rand = [l time?] + 1; x drand48!; y drand48!; test greater: (y,[expr=`1-(x*x)' ?]) true: `y = [expr=`1-(x*x)' ?];' ; z drand48!; test greater: (z,[expr=`1-(x*x)-(y*y)' ?]) true: `z = [expr=`1-(x*x)-(y*y)' ?];' ; ups nodes+ (rand, x, y, z); s data+ [rand drand48?]; ' start! ; ups print:no_points ; s print:size; ;
visage_data_set new: vds geometry=ups scalar_data=s ;
delaunay new: del debugon! data_in= vds ;
data_geometry new: dg data_in= del ;
display_all new: draw_mesh data_in= dg range= (0,1) ;
actor new: a modeller= draw_mesh ;
renderer new: aren actors= [actor instances?]
render! ;
loop new: rotate duration=100000 tick_actions=` a rotate_x: 5 rotate_y:3 rotate_z:1; aren render!; ' ;