ContourTriangulator
Introduction
vtkContourTriangulator
Methods
extend
Method use to decorate a given object (publicAPI+model) with vtkContourTriangulator 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 | IContourTriangulatorInitialValues | No | (default: {}) |
getTriangulatePolys
Returns the behavior of the filter regarding polys.
newInstance
Method use to create a new instance of vtkContourTriangulator
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IContourTriangulatorInitialValues | No | for pre-setting some of its content |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | any | Yes | |
outData | any | Yes |
setTriangulatePolys
Sets the behavior of the filter regarding polys.
| Argument | Type | Required | Description |
|---|---|---|---|
triangulate | boolean | Yes | whether the filter should triangulate polys or leave them untouched. True by default |
triangulateContours
This is a complex subroutine that takes a collection of lines that were formed by cutting a polydata with a plane, and generates a face that has those lines as its edges. The lines must form one or more closed contours, but they need not be sorted.
Only "numLine" lines starting from "firstLine" are used to create new polygons, and the new polygons are appended to "polys". The normal of the cut plane must be provided so that polys will be correctly oriented.
Given some closed contour lines, create a triangle mesh that fills those lines. The input lines do not have to be in tail-to-tip order. Only numLines starting from firstLine will be used. Note that holes can be indicated by contour loops whose normals are in the opposite direction to the provided normal.
| Argument | Type | Required | Description |
|---|---|---|---|
polyData | vtkPolyData | Yes | |
firstLine | Number | Yes | |
numLines | Number | Yes | |
polys | vtkCellArray | Yes | |
normal | Nullable<Vector3> | Yes | If null, the function will compute the normal of the polys. |
triangulatePolys | Boolean | No | (default: true) If set to true the resulting polygons will be triangulated, otherwise the polygons |
| themselves will be added to the output. | |||
diagnoseOnTriangulationError | Boolean | No | (default: false) If this option is set to true and there was a triangulation error |
| this will add the polys as outlines to the output. |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if triangulation was successful, false otherwise. |
triangulatePolygon
A robust method for triangulating a polygon. It cleans up the polygon and then applies the ear-cut triangulation. A zero return value indicates that triangulation failed.
| Argument | Type | Required | Description |
|---|---|---|---|
polygon | Array<Number> or TypedArray | Yes | Array of point indices defining the polygon |
points | vtkPoints | Yes | The point coordinates of the polygon |
triangles | vtkCellArray | Yes | The cell array that is going to be filled with the triangulation |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if triangulation was successful, false otherwise. |