There are three ways to create the structured point data:
1 using scripts (use the data=, data+ methods from visage_data superclass),
2 using the netCDF reader.
3 or using a mio reader.
The examples in this man page show how to create a structured point using a script. For large data sets, however, this is impractical and one of the reader objects should be used.
aspect_ratio the cell scaling factor. If a volume is of topological dimensions (10,10,10) and physical dimensions (100,100,250) then the aspect ratio is (10,10,25).
origin a positional offset from the origin. Effectively translates the volume in 3D space (useful for sampling points, see gaussian_sampler).
aspect_ratio=(ax,ay,az) set the volume aspect_ratio. By default aspect_ratio=(1,1,1).
aspect_ratio? get the volume aspect_ratio.
origin=(ox,oy,oz) set the volume origin. By default origin=(0,0,0).
origin? get the volume origin.
number_points?,no_points? get the number of points in the volume.
cell_coords! internal method to compute cell coordinates from current cell, origin, aspect ratio, and dimensions.
compute_bounds! compute the min/max bounding box of the volume.
location! compute the location of a x-y-z point from an initial position. The location is the cell number plus the parametric coordinates (r-s-t) in the cell.
position! compute the position of a point from the cell number and parametric coordinates.
output! formatted print (using unix command more) of data values.
/* * Create structured grid */ structured_point_set new: volume dimensions= (2,3,4) aspect_ratio=(1,2,5) ; /* * Vector data */ 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.) ; /* * Scalar data */ 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.) ; /* * Create a data set */ visage_data_set new: adata_set geometry= volume scalar_data= pressure vector_data= velocity ; /* * Now create a visual image */ /* * Create an outline */ data_outline new: an_outline data_in= adata_set generate_data! ; display_lines new: draw_outline data_in= an_outline ; actor new: outline_actor modeller=draw_outline ; /* * Create a geometry */ data_geometry new: a_geometry extent=(1,1,1,3,1,4) data_in= adata_set ; display_surface new: draw_surface data_in= a_geometry ; actor new: geometry_actor modeller=draw_surface ; /* * Create an iso-surface */ data_iso_surface new: iso value=2.0 data_in= adata_set
; display_all new: draw_iso data_in= iso ; actor new: iso_actor modeller=draw_iso ; /* * Render the image */ renderer new: aren actors= [actor instances?] render! ;