DVoffset


Synopsis

deform a mesh by data vector component at each node


group DVoffset {
Mesh+Node_Data+IPort2 &in ;
int+IPort2 component;
float+IPort2 scale;
Grid+Xform out_grid {
nnodes => in.nnodes;
nspace => in.nspace;
&xform => in.xform;
int npoints => nnodes;
float points[nnodes][nspace];
coordinates {
values+nres => in.coordinates.values +
scale*in.node_data[component].values;
};
};
Mesh+Node_Data+OPort2 &out => merge(out_grid, in);
};

Description

DVoffset "physically" deforms a mesh by the values of a 1, 2 or 3 vector component located at each node. The first element of the vector translates the node's X coordinate, the second (if present) translates the Y coordinate, and the third (again, if present) translates the Z coordinate. The magnitude of each translation is proportional to the values at the nodes multiplied by a scaling factor.

Input

&in

A reference to a field with Mesh and Node_Data. Its components can be a 1, 2, or 3 element vector.

component

An integer. Selects which of the Node_Data's components to use for the offset calculation.

scale

A float. A scaling factor to adjust the degree of distortion caused by the vector component.

Output

&out

A reference to an object that is the merge of the new Grid, plus a reference to the remaining fields of the input mesh, plus a reference to the original Node_Data. Mesh --> Mesh. Mesh_Struct or Mesh_Unif or Mesh_Rect --> Mesh_Struct.

Files

v/dproc.c

Utility DVM macros

DVMoffset_param

Example

Libraries.Main.Mappers.offset

See also

Not applicable.