triangle_filter(comp_geom) Filter triangle_filter(comp_geom)
NAME
triangle_filter - convert polygons and triangle strips
into triangle polygons
DESCRIPTION
Triangle_filter takes as input a display_data object and
converts polygons and triangle strips into triangles. The
motivation for this filter is that some algorithms (like
decimate) and data writers (like sla_writer or
mcubes_writer) can only handle triangles. All point data
(scalars, vectors, normals, and texture coordinates) are
passed through the filter.
Triangle_filter uses a recursive polygon splitting algorithm to triangulate the polygons. The algorithm repeatedly splits each polygon, maximizing aspect ratio, until
only triangles are left. Triangle strips are simply broken down into their individual triangles.
SUPERCLASS
display_filter
INSTANCE VARIABLES
(all inherited)
generate_data!
create triangles from input data.
EXAMPLE
display_data new: dd
points=(
0,0,0,
1,0,0,
1,1,0,
0.5,1.5,0,
0,1,0,
2,0,0,
3,0,0,
2,1,0,
3,1,0,
2,2,0,
3,2,0,
1.5,3,0,
)
polygons=(
5,1,2,3,4,5,
4,2,3,8,6,
5,3,4,12,10,8,
)
tri_strips=(
6,6,7,8,9,10,11,
)
;
triangle_filter new: tf
data_in= dd
debugon!
;
display_all new: da
data_in= tf
;
actor new: a
modeller= da
;
renderer new: aren
render!
;
SEE ALSO
display_filter, decimate, triangle_strip_filter,
sla_writer, mcubes_writer
Please send comments and suggestions toconsult@rpi.edu