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.
shrink_factor? get the value of the shrink_factor.
/* * 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?";