The data grid to use. Must not contain any NaN or null values.
Optional
debugMode: boolean(optional) Pass true
to log warnings on (rare) critical edge cases where the algorithm might fail.
Private
dataPrivate
rawStatic
CLOSE_Static
CLOSE_Static
CLOSE_Private
areChecks if both value are on the same side of the critical value (above or below). The closeGapType
indictes if CLOSE_GAP_TYPE_BELOW
or CLOSE_GAP_TYPE_ABOVE
should be used as a rule.
This procedure will look at the face4 at the ((x,y),(nextX,nextY)) position – which are four values – and determines the local contour lines for these cases.
This is used to detect and calculate edge cases on the borders of the underliying height data:
Resulting path segments will be stored in the global rawLinearPathSegments
array for further processing.
CLOSE_GAP_TYPE_ABOVE or CLOSE_GAP_TYPE_BELOW.
Detect contour paths from the underlying data source.
The height value. If above data's maximum or below data's minimum then the result will be empty (no intersections).
Optional
options: { CLOSE_GAP_TYPE_NONE
or CLOSE_GAP_TYPE_ABOVE
or CLOSE_GAP_TYPE_BELOW
.
Optional
onOptional
path(optional) The epsilon to tell if two points are located 'in the same place'. Used for connected path detection. If not specified the value 0.0000001
is used.
Optional
point(optional) The epsilon for duplicate point elimination (default is 0.000001).
Optional
useIf set to true the detection will split each face3 quad into two triangle faces.
Private
findThis function will calculate a single intersecion line of the given face4 data
segment. If the given face does not intersect with the plane at the given heightValue
then no segments will be stored.
The x position (index) of the data face.
The y position (index) of the data face.
The data sample that composes the face4 as a two-dimensional number array.
The height value of the intersection plane to check for.
Private
findThis function will calculate a single intersecion line of the given face4 data
segment. If the given face does not intersect with the plane at the given heightValue
then no segments will be stored.
The x position (index) of the data face.
The y position (index) of the data face.
The data sample that composes the face4 as a two-dimensional number array.
Optional
useTriangles: booleanPrivate
findThis function will calculate a single intersecion line of the given face3 data
segment. If the given face does not intersect with the plane at the given heightValue
then no segments will be stored.
The x position (index) of the first triangle data point.
The y position (index) of the first triangle data point.
The data sample that composes the face4 as a two-dimensional number array.
The height value of the intersection plane to check for.
Private
getGet a 'lerp' value - which is some sort of percentage/ratio for the curValue
inside the
range of the given interval [valA ... valB]
.
Examples:
Private
isTest if a given numeric value (curValue
) is between the given values valA
and valB
.
Value A and B don't need to be in ascending order, so valA <= curValue <= valB
and valB <= curvalue <= valA
will do the job.
The first of the two bounds.
The second of the two bounds.
The value to check if it is between (or equal) to the given bounds.
Private
lerpHelper function to lerp a numeric value.
The min (start) value. Doesn't necesarily need to be the smaller one.
The max (end) value. Doesn't necesarily need to be the larger one.
The lerp ratio; usually a value between 0.0 and 1.0, but other values a valid for linear interpolation, too.
Creates a new instance for calculating contour lines from the given data grid.