lower is the lower threshold value.
threshold_by is a flag indicating the method of thresholding. If the value is 0, points less than or equal to the lower threshold value will be output. If the value is 1, points greater than the lower threshold value and less than the upper threshold value will be output. If the value is 2, points greater than the upper threshold value will be output.
threshold_by_vectors is a flag indicating if the thresholding should be done on the basis of vector lengths instead of scalar values.
lower= value Set the lower threshold value.
upper? Get the upper threshold value.
upper= value Set the upper threshold value.
threshold_by? Get the current thresholding technique.
threshold_by= value Set the thresholding technique.
threshold_by_lower: value Set the lower threshold value, as well as setting the threshold technique to use the lower value.
threshold_by_upper: value Set the upper threshold value, as well as setting the threshold technique to use the upper value.
threshold_between: (lower,upper) Set the lower and upper threshold value, and set the threshold technique to threshold between the two values.
threshold_by_vectors_off! Set the threshold_by_vectors variable to FALSE (zero)
threshold_by_vectors_on! Set the threshold_by_vectors variable to TRUE (one)
threshold_by_vectors=argument Set the threshold_by_vectors variable to the argument.
threshold_by_vectors? Return the threshold_by_vectors variable.
/* * Create display data */ display_data new: dd points=( 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1 ) scalars=( 0, 1, 2, 3, 4, 5, 6,
7 ) lines=( 2,1,2, 2,2,3, 2,3,4, 2,4,1, 2,5,6, 2,6,7, 2,7,8, 2,8,1, 2,1,5, 2,2,6, 2,3,7, 2,4,8 ) polygons=( 3,1,2,3, 3,3,4,1, 3,5,6,7, 3,7,8,5, 4,1,2,6,5, 4,2,3,7,6, 4,3,4,8,7, 4,4,1,5,8 ) ; threshold_points new: tp data_in= dd threshold_between: (2,6) ; display_all new: da data_in= tp range= [dd range?] ; actor new: a modeller= da ; renderer new: aren actors= [actor instances?] render! ;
In this example a data set (e.g., structured_grid_set plus scalars and vectors) is read using the plot3d reader, an outline is drawn, and the data_geometry object is used to extract points from the data_set. These points are passed through the threshold_points object and thresholding is performed on the velocity magnitude. Then the hedgehog filter is used to draw oriented and colored lines at each point generated by thresholding.
/* * read in the data */ string new: data_name=bluntfin;
plot3d_reader new: areader file_prefix=data_name read! ; /* * Set up the data set */ string new: data_set = data_name + "_gridset01"; string new: geometry = data_set + "_grid"; string new: scalar_data = data_set + "_velocity.magnitude"; string new: vector_data = data_set + "_velocity";
object# data_set scalar_data= scalar_data vector_data= vector_data compute_properties! ; /* * Compute the initial threshold and other parameters */
scalar new: current_scale= 0.01 * [object# geometry length?] / [object# vector_data max_length?];
scalar new: thresh_value = [object# vector_data max_length?] * 0.9 ; vector new: range dimension=2 = ([object# scalar_data minmax?]) ; /* * set up some displays */ data_geometry new: dg data_in=data_set extent=(1,100,1,100,1,100) ; threshold_points new: thresh data_in= dg threshold_by_upper:thresh_value ; hedgehog new: hhog data_in= thresh scale_factor = current_scale ; display_lines new: draw_lines data_in= hhog range= ([thresh_value ?],[range @2 ?])
;
actor new: a modeller=draw_lines ; display_outline new: outline data_in= data_set ; display_lines new: draw_outline data_in=outline ; actor new: outline_actor modeller= draw_outline ;
vector new: bbox dimension=6; bbox = ([object# data_set bounds?]); camera new: acamera x_range=([bbox @1 ?],[bbox @2 ?]) y_range=([bbox @3 ?],[bbox @4 ?]) z_range=([bbox @5 ?],[bbox @6 ?]) default! on! ;
light new: alight position=(30,30,50) on! ;
logic new: test; environment new: _env variable="LYMB_RENDERER"; test = [_env defined?] false: "#Environment variable LYMB_RENDERER must be set." false: "parser exit!;" ; string new: current_renderer = [_env value?];
object# current_renderer new: main_renderer actors=([actor instances?]) lights=alight cameras=acamera render! ; /* * Create a control panel to manipulate object */ environment new: _display variable="DISPLAY";
test = [_display defined?] false: "# Please define DISPLAY variable" false: "ui exit!;"
true: "
SEE ALSO
display_filter, data_geometry, hedgehog, draw_lines, display_data
Please send comments and suggestions toconsult@rpi.edu