![]() |
![]() |
![]() |
![]() |
DVcrop_rect
Synopsis
extract a subset of a rectilinear field
module DVcrop_rect {
Mesh_Rect+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
int+Iparam min[in.ndim];
int+Iparam max[in.ndim];
Mesh_Rect+Node_Data+Oparam out{
&xform+nowrite => in.xform;
};
method+notify_val+notify_inst upd_crop<status=1> = "DVcrop_rect_update";
};Description
DVcrop_rect reduces the size of a Mesh_Rect field by extracting the data within a specified range of its dimensions. The process is analogous to "cropping" a photographic image. Typical uses are to eliminate uninteresting portions of the data and to increase processing speed by reducing the amount of data.
Input
Integers. These are references to 1D arrays that will hold the minimum and maximum X (Y, and Z) coordinates for the cropping operation. The arrays take their length from the ndim of the input Grid_Struct, i.e., a 1D mesh needs only 1 array element to specify X min and max coordinates, a 2D mesh needs 2 array elements for X and Y, etc.
Output
The output field contains a new Mesh_Rect. Its points array (extents) are modified to retain the mesh's position in space. For example, the following 1D field has a points array (extents) from 0 to 49. ...................1 ................ 2................. 3................. 4 01234567890123456789012345678901234567890123456789 You crop the field using an I min of 30 and an I max of 49. The output field has coordinate indices from 0 to 19 and a points array from 30 to 49. ..............................3..................4 ..............................01234567890123456789The output field also contains a new Node_Data that has the data within the cropped region.
Example
File
See also
![]() |
![]() |
![]() |
![]() |