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

rotational_snap_filter(display)Filterrotational_snap_filter(display)

NAME

rotational_snap_filter - creates a closed surface by shooting rays through cylinder into source display data. Cylinder is created by rotating a line around y-axis.

DESCRIPTION

Rotational_snap_filter takes as input a display_data object containing a line in xy plane. It rotates this line around Y axis and snaps each point in generated cylinder to the source display_data object. Snapping is done in the direction parallel to xz plane. The source geometry should be a topological cylinder with its axis parallel to y axis. The hole in source geometry is sealed by placing an generalized elliptical cap.

SUPERCLASS

adjacency_filter

INSTANCE VARIABLES

resolution the number of steps (facets) that span the rotational angle.

angle the total angle of rotation (in degrees).

MESSAGES

resolution=/+ value set/add to the resolution instance variable.

resolution? get the resolution value.

angle=/+ value set/add to the angle instance variable.

angle? get the angle value.

generate_data! create the extruded data from the input data.

EXAMPLE

/* * This script demonstrates the creation of closed torso model based in cdf * data of cyberscaned torso */

cdf_display_data_reader new: torso_data filename= `/home/lishakill/projects/lymb_dev/lymb/scripts/filters/volpe.cdf' ;

/* * Create top and bottom planes to cut out jaggy edges of the original data. */

display_data new: normals points=(0,0.128,0,0,-0.138,0) normals=(0,1,0,0,-1,0) ;

clipping_filter new: clip data_in=`torso_data' sources=`normals' generate_data! ;

display_polygons new: polys data_in=`clip' ;

/* * This object is used to do raytracing of original data */

display_data_geometry new:ddg tolerance=.001 data=[clip data?] ;

/* * Create some vectors and scalar to calculate center and scale of * original data */

vector new: `a' dimension=24 = [polys bounding_box?]; scalar new: `temp';

vector new: `ascale' dimension=3 @ 1 = [temp = [a @ 1 ?] - [a @ 7 ?] / 2 ?] @ 2 = [temp = [a @ 2 ?] - [a @ 8 ?] / 2 ?] @ 3 = [temp = [a @ 9 ?] - [a @ 15 ?] / 2 ?] ;

/* * The following two vectors are profiles of the rotational cyliner; * they represent vertical lines and quorter of ellipses in xy plane; * ysb for the bottom part and yst for the top part of the constructed torso */

vector new: ysb = (1,0.0,0, 1,-0.2,0, 1,-0.4,0, 1,-0.6,0, 1,-0.8,0, 1,-1,0,

0.9,-1.108972,0, 0.8,-1.15,0, 0.6,-1.2151,0, 0.4,-1.2291,0, 0.2,-1.2449,0, 0,-1.25,0) ;

vector new: yst =( 1,0,0, 1,0.2,0, 1,0.4,0, 1,0.6,0, 1,0.8,0, 1,1,0, 0.9,1.108972,0, 0.8,1.1500,0, 0.6,1.2151,0, 0.4,1.2291,0, 0.2,1.2449,0, 0,1.25,0

);

display_data new: profile_bottom points=ysb scalars=( 1,2,3,4,5,6,7,8,9,10,11,12

) lines=( 12,1,2,3,4,5,6,7,8,9,10,11,12 ) ;

transform_filter new:tfb data_in= profile_bottom position=[polys center?] scale=(1,[ascale @ 2 ?],1) ;

display_data new: profile_top points=yst scalars=( 1,2,3,4,5,6,7,8,9,10,11,12

) lines=( 12,1,2,3,4,5,6,7,8,9,10,11,12 ) ;

transform_filter new:tft data_in= profile_top

position=[polys center?] scale=(1,[ascale @ 2 ?],1) generate_data! ;

rotational_snap_filter new: ref_bottom sources=`ddg' data_in= tfb resolution= 20 angle= 360 ;

display_all new: da_b data_in= ref_bottom ;

actor new: cyl_b modeller= da_b ;

rotational_snap_filter new: ref_top sources=`ddg' data_in= tft resolution= 20 angle= 360 ;

display_all new: da_t data_in= ref_top ;

actor new: cyl_t modeller= da_t ;

actor new: atorso modeller=`polys' color=(0,1,0) ;

renderer new: aren actors=(atorso) pref_size=(256,256) background=(.8,.8,.8) ;

/* * Render the original geometry */

aren render!;

/* * Now render the generated geometry

*/ ! ! It takes some time to generate new geometry, be patient ! aren actors=(cyl_b,cyl_t) render! ;

SEE ALSO

adjacency_filter, spherical_snap_filter, display_filter, display_data


Please send comments and suggestions to
consult@rpi.edu