Description
Using the gts_isosurface_cartesian() function, it is possible to build a triangulated isosurface of a given user-defined function. As its name indicates this function assumes that the values of the user-defined function are defined for points located on a regular cartesian grid described by the GtsCartesianGrid parameter. The triangles describing the isosurface are computed for each pair of successive planes z and z+dz in a pipelined manner. Consequently only two planes need to be stored in memory at any time. This allows to construct isosurfaces for datasets too large to fit in main memory.
Details
struct GtsCartesianGrid
struct GtsCartesianGrid {
guint nx, ny, nz;
gdouble x, dx, y, dy, z, dz;
}; |
A regular cartesian grid is defined by the number of points in each direction, the spatial increment in each direction and the coordinates of the first point.
struct GtsGridPlane
struct GtsGridPlane {
GtsPoint ** p;
guint nx, ny;
}; |
gts_grid_plane_destroy ()
struct GtsIsoSlice
A GtsIsoSlice is an opaque data structure containing the coordinates of the points located on the isosurface for a given slice of the user-defined function.
gts_iso_slice_fill ()
Fill slice with the coordinates of the vertices defined by
f1 (x,y,z) = iso and f2 (x, y, z) = iso.
gts_iso_slice_fill_cartesian ()
Fill slice with the coordinates of the vertices defined by
f1 (x,y,z) = iso and f2 (x, y, z) = iso.
gts_iso_slice_destroy ()
Free all memory allocated for slice.
gts_isosurface_slice ()
Given two successive slices slice1 and slice2 link their vertices with
segments and triangles which are added to surface.
GtsIsoCartesianFunc ()
void (*GtsIsoCartesianFunc) (gdouble **a,
GtsCartesianGrid g,
guint i,
gpointer data); |
This user-defined function is passed to the gts_isosurface_cartesian()
function. Given a particular GtsCartesianGrid g it must fill the array a
with the values of the function for the plane z=g.z (or for the corresponding
index i). This function is always called in order by gts_isosurface_cartesian(), i.e. i varies from 0 to g.nz - 1 with an increment of one (and similarly g.z is incremented every time by g.dz).
gts_isosurface_cartesian ()
Adds to surface new faces defining the isosurface f(x,y,z) = iso. By
convention, the normals to the surface are pointing toward the positive
values of f(x,y,z) - iso.
The user function f is called successively for each value of the z
coordinate defined by g. It must fill the corresponding (x,y) plane with
the values of the function for which the isosurface is to be computed.
gts_isosurface_tetra ()
Adds to surface new faces defining the isosurface f(x,y,z) =
iso. By convention, the normals to the surface are pointing toward
the positive values of f(x,y,z) - iso.
The user function f is called successively for each value of the z
coordinate defined by g. It must fill the corresponding (x,y)
plane with the values of the function for which the isosurface is
to be computed.
gts_isosurface_tetra_bounded ()
Adds to surface new faces defining the isosurface f(x,y,z) =
iso. By convention, the normals to the surface are pointing toward
the positive values of f(x,y,z) - iso. To ensure a closed object,
a boundary of G_MINDOUBLE is added around the domain
The user function f is called successively for each value of the z
coordinate defined by g. It must fill the corresponding (x,y)
plane with the values of the function for which the isosurface is
to be computed.