API / geotoolkit3d / scene / surface / contour / Triangle / Triangle
Contour triangle class.
This class calculates the center point on isoline, triangle normal, and length of isoline intercepted an arbitrary triangle in 3D space.
Example
a a-------b
/ \ \ /
e1 /---\ e2 elevation e1 \---/ e2
/_____\ \ /
b c cConstructors
Methods
Constructors
• new Triangle(a?, b?, c?, elevation?, sorted?)
Constructor for the Triangle utility. It is advised to reuse the class instead of creating a new one for each calculation. Triangle values and properties are optional and can be set later using setProperties().
| Name | Type | Description |
|---|---|---|
Optional a | number[] | the first vertex |
Optional b | number[] | the second vertex |
Optional c | number[] | the third vertex |
Optional elevation | number | the elevation that cross the triangle |
Optional sorted | boolean | true if vertices are sorted in ascending by elevation |
Methods
▸ getClassName(): string
string
▸ getIntersectedLength(): number
Return the intersected length between isoline and triangle
number
length
▸ getLeftIntersection(): number[]
Return the left intersected point in array
number[]
leftIntersection
▸ getLeftIntersectionPoint(): Vector3
Return the left intersected point in THREE.Vector3
Vector3
v3
▸ getNormal(): Vector3
Return the normal of this triangle
Vector3
normal
▸ getPoint(): Vector3
Return the middle point of intersected isoline in triangle
Vector3
point
▸ getRightIntersection(): number[]
Return the right intersected point in array
number[]
rightIntersection
▸ getRightIntersectionPoint(): Vector3
Return the right intersected point in THREE.Vector3
Vector3
v3
▸ getSortedVertices(): Vector3[]
Return sorted vertices from highest to lowest elevation in an array
Vector3[]
vertices
▸ isIntersectElevation(): boolean
Returns if this triangle intersect the given elevation.
boolean
▸ isLineIntersection(): boolean
Returns if the intersection between this triangle ad the given elevation form a line.
boolean
▸ isVerticesValid(): boolean
Returns if this triangle is made of points made of real numbers.
boolean
▸ reset(): void
Reset the properties of this triangle
void
▸ setProperties(a, b, c, elevation, sorted?): void
Set triangle's properties such as vertices and elevation
| Name | Type | Description |
|---|---|---|
a | number[] | the first vertex |
b | number[] | the second vertex |
c | number[] | the third vertex |
elevation | number | the elevation that cross the triangle |
Optional sorted | boolean | true if the given vertices are already sorted in ascending order by elevation |
void
▸ Static getClassName(): string
string