produce a mesh representing an isosurface
group DViso {
Mesh+Node_Data+Iparam &in {
xform_nonotify;
nnodes+req;
};
float+Iparam level;
Mesh+Oparam out {
&xform<weight=-1> => in.xform;
};
NParam_Data+Oparam nparam;
method+notify_val+notify_inst iso_update = "iso";
} ;
DViso is used to create isosurfaces--a 3D contour surface that passes through all cells containing a specified level value. The surface may actually occur between node locations. For example, if one node has a component value of 1.0, and the adjacent node's component value is 2.0, then if the user sets a level value of 1.5, the surface Mesh is interpolated and will occur midway between the two real nodes.
The input is a reference to a field with Mesh and Node_Data. Both structured and unstructured meshes are fully supported. It uses the first component of the Node_Data, which must be a scalar component.
A float. Sets the value for which an isosurface will be constructed. Its data type will be converted to the Node_Data's data type before use.
The output is a new object. It is an unstructured Mesh made up of one cell set. The cell type is Tri. The Mesh is the location of the isosurface. It includes a reference to the input field's xform.
This output is of type NParam_Data, which is defined as follows in v/fld.v:
dgroup NParam_Data {
int nnodes;
int min_node[nnodes];
int max_node[nnodes];
float tpar[nnodes];
};
One often wishes to map the values of one component (for example, temperature), as a color onto the isosurface of another component (say, pressure). The picture would show an isosurface of component pressure = .25, and that surface would be colored by the interpolated temperature component values all along that isosurface.
To perform this mapping most efficiently, using a minimum of memory and node data processing, DViso outputs only a "table" that lists which pairs of nodes the isosurface crossed, and a parametric value from between 0.0 and 1.0 that tells where the isosurface crossed between the nodes. A different base module, DVnmap, can take this nparam data and quickly calculate interpolated values for any other component.
For example, consider the simpler 2D Mesh case. There are six nodes in two cells. The user-specified pressure component isosurface level is .25
The original Node_Data Data_Array is:
Array Index values[nvals][veclen]
|
|
The nparam structure output by DViso would look like this:
|
|
|
That is, between the node that is the nval = 1 index into the component's Data_Array and node that is the nval = 4 index, the pressure component isosurface mesh crosses at .5. Thus, when DVnmap is trying to figure out what numeric value to produce for a temperature at that location, it knows that all it has to do is use the temperature component's nval = 1 and nval = 4 index node values and calculate ((nval[4] - nval[1]) * tpar).
isosurface uses the Marching Cubes algorithm to construct the isosurface. See W. Lorensen and H. Cline, "Marching Cubes: A High Resolution Surface Reconstruction Algorithm." Computer Graphics 21(4) (SIGGRAPH Proceedings, 1987), July, 1987, pp. 163-169.
This algorithm has a known limitation. There are cases where there are two possible paths that the isosurface could take through a cell, and only one is the correct path. If isosurface picks the wrong path, it will appear as a discontinuity in the surface such as a hole.
Libraries.Main.Mappers.isosurface
Libraries.Main.Mappers.slice