The plane is defined by specifying a point and a normal to the plane, and is assumed infinited in extent. The plane must cut through the data set, otherwise the output display_data will be empty.
normal a normal defining the cut plane
point+ (x,y,z) Add to the current point location.
point? Get the point location.
normal= (x,y,z) Set the current plane normal.
normal+ (x,y,z) Add to the current plane normal.
normal? Get the current plane normal.
pull: value Move the plane along the direction of the normal by specified value. If value is negative, plane moves in direction opposite normal.
/* * Script to illustrate use of cut plane */
/* string new: data_name=adata_set;
string new: data_set = adata_set; string new: geometry = grid; string new: scalar_data = pressure; string new: vector_data = velocity;
structured_grid_set new: grid dimensions= (2,3,4); grid data=(0., 0., 0., 1., 0., 0., 0., 1., 0., 1., 1., 0., 0., 2., 0., 1., 2., 0.) data+(0., 0., 1., 1., 0., 1., 0., 1., 1., 1., 1., 1., 0., 2., 1., 1., 2., 1.) data+(0., 0., 2., 1., 0., 2., 0., 1., 2., 1., 1., 2., 0., 2., 2., 1., 2., 2.) data+(0., 0., 3., 1., 0., 3., 0., 1., 3., 1., 1., 3., 0., 2., 3., 1., 2., 3.) ;
visage_vector new: velocity; velocity data= (0., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) data+ (1., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) data+ (2., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) data+ (2., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) data+ (2., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) data+ (3., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) ;
visage_scalar new: pressure; pressure data=(0., 0., 0., 1., 0., 0., 0., 2., 0., 0., 0., 3.) data+ (1., 1., 1., 2., 1., 1., 3., 2., 1., 1., 1., 3.) ;
visage_data_set new: adata_set geometry= grid scalar_data= pressure vector_data= velocity compute_properties! ; */
string new: data_name=case1;
string new: data_set = data_name + "_gridset01"; string new: geometry = data_set + "_grid"; string new: scalar_data = data_set + "_density"; string new: vector_data = data_set + "_momentum";
plot3d_reader new: areader file_prefix=data_name derived_data_off! read!
;
object# data_set scalar_data= scalar_data vector_data_off! compute_properties! ;
/* * Compute the initial threshold and other parameters */
scalar new: current_scale= 0.1 * [object# geometry length?] / [object# vector_data max_length?] ; vector new: range dimension=2 = ([object# scalar_data minmax?]) ; /* * Pipeline: outline plus cut plane */ display_outline new: outline data_in= data_set ; display_lines new: draw_outline data_in=outline ; actor new: outline_actor modeller=draw_outline ;
data_cut_plane new: cutter data_in= data_set point=(10.2,0,30.3) normal=(1,0,0) ; warp_vector new: warp data_in= cutter scale_factor= current_scale ; display_all new: draw_cutter data_in= cutter range= range ; actor new: probe_actor modeller=draw_cutter ;
/* * Renderer stuff */ environment new: _env variable="LYMB_RENDERER";
string new: current_renderer = [_env value?];
light new: alight on!;
vector new: bbox dimension=6; bbox = ([object# data_set 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 render! ;
/* * Cues / scenes for pulling cut plane */ vector new: pull_plane_start_point dimension=3; vector new: pull_plane_end_point dimension=3; scalar new: current_pull_distance; vector new: current_pull_vector dimension=3;
pull_plane_start_point = ([bbox @1 ?], [bbox @3 ?], [bbox @5 ?]); pull_plane_end_point = ([bbox @2 ?], [bbox @4 ?], [bbox @6 ?]); current_pull_vector = pull_plane_end_point - pull_plane_start_point; current_pull_vector = pull_plane_end_point - pull_plane_start_point;
cue new: pull_plane resolution=1 duration=12 start_actions+ " cutter point=pull_plane_start_point normal=current_pull_vector ; " start_actions+ "current_pull_distance = [current_pull_vector length?] / [pull_plane duration?];" tick_actions= "cutter pull: current_pull_distance;" end_actions= "pull_plane time=-1;" ;
ui_scene new: ascene
resolution=1 duration=12 cues=pull_plane renderers=main_renderer ; /* * Create a control panel to manipulate object */ environment new: _display variable="DISPLAY";
logic new: test;
test = [_display defined?]
false: "# Please define DISPLAY variable"
false: "ui exit!;"
true: "
SEE ALSO
computed_feature, data_outline, plot3d_reader, display_data
Please send comments and suggestions toconsult@rpi.edu