DVisoline


Synopsis

create contour lines of constant value


group DVisoline {
Mesh+Node_Data+Iparam &in { /* input field */
xform_nonotify;
nnodes+req;
};
int+Iparam component;
float+Iparam level; /* isoline level */
int+Iparam color; /* toggle for colored lines */
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst isoline_update = "isoline";
};

Description

DVisoline creates contour lines of a given level value in a 2D field. The contour lines can be colored by the level value. The selected component must be scalar.

Input

&in

The input is a reference to a field with a 2D mesh and Node_Data. The mesh can be of any defined type (Mesh, Mesh_Struct, Mesh_Unif, Mesh_Rect). However, the mesh must be 2D (nspace = 2 in structured fields, cell_ndim = 2 in unstructured fields). No checking is done to ensure that the mesh is 2D. 3D meshes will not generate output. The Node_Data must have a single scalar component.

level

A float. Sets the isoline level. The data type is converted to the data type of the input field prior to use.

color

An integer. If the value is not 0, then the isolines will be colored by the level value.

Output

out

The output is a new object that contains an unstructured Mesh of cell type Line that represents the contour lines. The value of the Node_Data is the level value.

Algorithm

For each "cell" of the 2D field, a straight line is created connecting locations on the cell's edges with an interpolated value equal to the level. The interpolation is linear.

Files

v/dv.v
modules/isoline.c

Example

Libraries.Main.Mappers.isoline

See also