Triangle
Introduction
vtkTriangle is a cell which representant a triangle. It contains static method to make some computations directly link to triangle.
See Also
vtkCell
Methods
cellBoundary
Get the nearest cell boundary to the specified parametric coordinates and whether the point is inside or outside the cell.
| Argument | Type | Required | Description |
|---|---|---|---|
subId | Number | Yes | The sub-id of the cell. |
pcoords | Vector3 | Yes | The parametric coordinates. |
pts | Vector2 | Yes | The points of the cell. |
clip
Clip the triangle against the given scalar value, appending the resulting triangles to tris and their interpolated attributes to outPd/outCd.
| Argument | Type | Required | Description |
|---|---|---|---|
value | Number | Yes | The clipping value |
cellScalars | vtkDataArray | Yes | The scalar value at each triangle corner |
locator | vtkPointLocator | Yes | Merges the generated points |
tris | vtkCellArray | Yes | Receives the generated triangles |
inPd | vtkDataSetAttributes | Yes | Input point data |
outPd | vtkDataSetAttributes | Yes | Output point data |
inCd | vtkDataSetAttributes | Yes | Input cell data |
cellId | Number | Yes | The id of this cell in the input |
outCd | vtkDataSetAttributes | Yes | Output cell data |
insideOut | Boolean | Yes | Keep the region below the value instead of above |
derivatives
Get the derivatives of the triangle at the specified parametric coordinates.
| Argument | Type | Required | Description |
|---|---|---|---|
subId | Number | Yes | - The sub-id of the triangle. |
pcoords | Vector3 | Yes | - The parametric coordinates. |
values | Array[Number] | Yes | - The values at the points. |
dim | Number | Yes | - The dimension. |
derivs | Array[Number] | Yes | - The derivatives. |
evaluateLocation
Determine global coordinates (x) from the given subId and parametric coordinates.
| Argument | Type | Required | Description |
|---|---|---|---|
pcoords | Vector3 | Yes | The parametric coordinates. |
x | Vector3 | Yes | The x point coordinate. |
weights | Array[Number] | Yes | The number of weights. |
evaluatePosition
Evaluates whether the specified point is inside (1), outside (0), or indeterminate (-1) for the cell; computes parametric coordinates, sub-cell ID (if applicable), squared distance to the cell (and closest point if requested), and interpolation weights for the cell.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Vector3 | Yes | The x point coordinate. |
closestPoint | Vector3 | Yes | The closest point coordinate. |
pcoords | Vector3 | Yes | The parametric coordinates. |
weights | Array[Number] | Yes | The number of weights. |
extend
Method used to decorate a given object (publicAPI+model) with vtkTriangle characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ITriangleInitialValues | No | (default: {}) |
getCellDimension
Get the topological dimensional of the cell (0, 1, 2 or 3).
getParametricDistance
Get the distance of the parametric coordinate provided to the cell.
| Argument | Type | Required | Description |
|---|---|---|---|
pcoords | Vector3 | Yes | The parametric coordinates. |
intersectWithLine
Compute the intersection point of the intersection between triangle and line defined by p1 and p2. tol Tolerance use for the position evaluation x is the point which intersect triangle (computed in function) pcoords parametric coordinates (computed in function) A javascript object is returned :
{
evaluation: define if the triangle has been intersected or not
subId: always set to 0
t: parametric coordinate along the line.
betweenPoints: Define if the intersection is between input points
}| Argument | Type | Required | Description |
|---|---|---|---|
p1 | Vector3 | Yes | The first point coordinate. |
p2 | Vector3 | Yes | The second point coordinate. |
tol | Number | Yes | The tolerance to use. |
x | Vector3 | Yes | The point which intersect triangle. |
pcoords | Vector3 | Yes | The parametric coordinates. |
newInstance
Method used to create a new instance of vtkTriangle.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ITriangleInitialValues | No | for pre-setting some of its content |