<<<<<<<<<<<<<<<<<

shrink_filter(display) Filter shrink_filter(display)

NAME

shrink_filter - shrinks geometry objects (points, lines, polygons, etc.) by a specified amount.

DESCRIPTION

The shrink_filter object takes as input a display_data object that may contain any combination of geometry and scalar, vector, and normal values. On output, the shrink_filter creates a display_data that fragments and shrinks (or grows) the geometry of the input display_data.

For example, if an input display_data contains a line comprised of 50 points (i.e., 49) segments, then the data_out will contain 49 lines and 98 points. Scalar, vector, and normal data will be copied appropriately. Each newly created line is shrunk towards it centroid by the value of the instance variable shrink_factor. Polygonal meshes are fragmented similarly, and triangle strips are broken up into individual polygons (each a triangle). Hence an interesting side effect of this filter is its ability to break up geometry into its component pieces, as well as converting triangle strips into polygons.

SUPERCLASS

display_filter

INSTANCE VARIABLES

shrink_factor Used to control the shrinking of the geometry. If shrink_factor=1, the geometry is not shrunk at all but fragmented. If shrink_factor<1, then the geometry is shrunk in size, and if shrink_factor>1, the geometry is increased in size (weird!).

MESSAGES

shrink_factor=unknown command: wf2 value set the value of the shrink_factor.

shrink_factor? get the value of the shrink_factor.

EXAMPLE

In this example a cube is created using polygon that share vertices. Scalar data are also assigned to the vertices of the polygons. A contour filter is then used to create contour lines around the cube. The cube and lines are then passed throught shrink filters to yield the final image.

/* * Script to shrink data */ -- unit cube - scalar values are edge distances from point at origin display_data new: dd

points=(0,0,0, 0,0,1, 0,1,1, 0,1,0, 1,0,0, 1,0,1, 1,1,1, 1,1,0) polygons=(4,1,2,3,4, 4,1,2,6,5, 4,2,3,7,6, 4,5,6,7,8, 4,1,4,8,5, 4,3,7,8,4) scalars=(0,1,2,1,1,2,3,2) ;

contour_filter new:cont_filt data_in=dd range=(0,3) number_contours=10 ; shrink_filter new: sf data_in=cont_filt shrink_factor = 0.5 ; display_lines new: draw_cont_lines data_in=sf range=(0,3) ; actor new: cont_lines_actor modeller=draw_cont_lines ;

shrink_filter new: sf2 data_in=dd shrink_factor = 0.5 ; display_surface new: draw_surface data_in=sf2 range=(0,3) ; actor new: surface_actor modeller=draw_surface ;

environment new: _env variable="LYMB_RENDERER"; string new: current_renderer = [_env value?];

light new: alight on!;

vector new: bbox dimension=6; bbox = ([dd bounds?]); camera new: acamera position=(1,1,1) x_range=([bbox @1 ?],[bbox @2 ?]) y_range=([bbox @3 ?],[bbox @4 ?]) z_range=([bbox @5 ?],[bbox @6 ?]) default! on! ;

object# current_renderer new: main_renderer actors=([actor instances?])

lights=alight cameras=acamera ;

main_renderer render!;

/* * User interface */ logic new: test; environment new: _display variable="DISPLAY"; test = [_display defined?] true: "# Camera.scr?";

SEE ALSO

display_feature, display_filter, data_geometry, display_data


Please send comments and suggestions to
consult@rpi.edu