DVsurf_plot


Synopsis

produce a 3D or 2D surface by extruding a 2D or 1D mesh according to data values


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

Description

DVsurf_plot creates a 3D or 2D mesh whose height at each point is proportional to the scalar data value at that node location in the original field. 2D input produces a 3D mesh. 1D input produces a 2D output.

Input

&in

The input is a reference to a field of any mesh type and any Node_Data. The field's mesh should have nspace=1 or 2. However, no checking is done to enforce this restriction. The Node_Data must contain at least one scalar component.

component

An integer. Sets which of the input's data components to use to set the mesh height.

scale

A float. Used to scale the height (scale*component values).

offset

A float. Raises or lowers the resulting mesh with respect to the input mesh so that both are visible at the same time.

Output

&out

The output is a reference to a merged group made up of the new object out_grid, which is a mesh of the same type as the input mesh, with nspace+1, whose coordinate values represent the projected, scaled, and offset surface, plus a reference to the original &in field.

Files

v/dv.v

Utility DVM macros

DVMsurf_plot_param

Example

Libraries.Main.Mappers.surf_plot

See also