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

contour_filter(display) Filter contour_filter(display)

NAME

contour_filter - generate line contours from display_data

DESCRIPTION

Contour_filter takes as input a display_data object, generating on output a display_data containing line contours. The input display_data object should contain surface primitives (e.g., polygons or triangle_strips) with scalar values at the vertices in order to generate the line contours. Note that the contour_filter object will interpolate the vector, normal, and texture coordinate information from the input display_data to the points of the output display_data.

Normally contour_filter is controlled by setting a min/max scalar range plus a number of contour lines. It is also possible to explicitly set the values for the contour lines with the "values=" method.

SUPERCLASS

display_filter

INSTANCE VARIABLES

range the scalar minimum and maximum values to generate contour lines between.

no_contours the number of contour lines to generate between the specified range.

MESSAGES

no_contours=/number_contours= value sets the maximum number of contour lines between specified range. Forces the value to be zero or greater. It is possible that no contour lines will be generated if the scalar values of the input display data do not fall within the specified range, or the range/number contours combination creates contour line values outside the scalar range.

no_contours?/number_contours? get the maximum number of contour lines between specified range.

range= (min,max) sets the range to generate contour lines within.

range? get the range.

values= (v1,v2,v3,...,vn) explicitly set the scalar values from which to generate contour lines.

EXAMPLE

In this example, a cube is created and contour lines are drawn around the cube.

/* * Script to generate contour lines around cube */ vector new: v dimension = 72 + (.3,.7,1) ;

-- 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) normals=v ;

contour_filter new:cont_filt data_in=dd range=(0,3) number_contours=10 ;

/* * Draw the contour lines */ display_all new: draw_cont_lines data_in=cont_filt range=(0,3) ; actor new: cont_lines_actor modeller=draw_cont_lines ; /* * Draw the cube */ display_all new: draw_surface data_in=dd range=(0,3) ; actor new: surface_actor modeller=draw_surface wireframe! ; /* * Graphics stuff */ 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!;

SEE ALSO

display_filter, display_data


Please send comments and suggestions to
consult@rpi.edu