Menu - Top - Home - Donate to Me


Back to documentation index.


The extras/contourlines.js module. To import all symbols in this module, either of the following can be used:

import * from "extras/contourlines.js";
// -- or --
import * as CustomModuleName from "extras/contourlines.js";


(static) module:extras/contourlines.contourLines(func, levels, u1, u2, v1, v2, usize, vsize)

Generates contour lines for two-dimensional data.


Return Value

A mesh buffer of line segments for the contour lines. (Type: MeshBuffer)


This example generates contour lines for a simple function. This method samples the function at integer grid points.

var mesh=contourLines((u,v)=>(Math.sin((u+v)/6)),
[0, 1, 2, 3],

(static) module:extras/contourlines.contourLines3D(mesh, planes)

Generates a mesh buffer of contour lines along the surface of a 3-dimensional triangle mesh.


Return Value

A mesh buffer containing the generated contour lines. Returns null if the input mesh's primitive type isn't triangles, or if the input mesh doesn't contain a "POSITION" buffer attribute with three elements per value. (Type: MeshBuffer)

Back to documentation index.