Skip to content

ContourTriangulator

Introduction

vtkContourTriangulator

Methods

extend

Method use to decorate a given object (publicAPI+model) with vtkContourTriangulator characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIContourTriangulatorInitialValuesNo(default: {})

getTriangulatePolys

Returns the behavior of the filter regarding polys.

newInstance

Method use to create a new instance of vtkContourTriangulator

ArgumentTypeRequiredDescription
initialValuesIContourTriangulatorInitialValuesNofor pre-setting some of its content

requestData

ArgumentTypeRequiredDescription
inDataanyYes
outDataanyYes

setTriangulatePolys

Sets the behavior of the filter regarding polys.

ArgumentTypeRequiredDescription
triangulatebooleanYeswhether 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.

ArgumentTypeRequiredDescription
polyDatavtkPolyDataYes
firstLineNumberYes
numLinesNumberYes
polysvtkCellArrayYes
normalNullable<Vector3>YesIf null, the function will compute the normal of the polys.
triangulatePolysBooleanNo(default: true) If set to true the resulting polygons will be triangulated, otherwise the polygons
themselves will be added to the output.
diagnoseOnTriangulationErrorBooleanNo(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

TypeDescription
BooleanReturns 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.

ArgumentTypeRequiredDescription
polygonArray<Number> or TypedArrayYesArray of point indices defining the polygon
pointsvtkPointsYesThe point coordinates of the polygon
trianglesvtkCellArrayYesThe cell array that is going to be filled with the triangulation

Returns

TypeDescription
BooleanReturns true if triangulation was successful, false otherwise.