Triangulator Class

(static) methods for triangulating polygons

  • @internal

Methods

Name Description
createFaceLoopFromCoordinates(graph: HalfEdgeGraph, data: LineStringDataVariant, returnPositiveAreaLoop: boolean, markExterior: boolean): HalfEdge | undefined Static create a circular doubly linked list of internal and external nodes from polygon points in the specified winding order
This applies the masks used by typical applications:
HalfEdgeMask.BOUNDARY on both sides
* HalfEdgeMask.PRIMARY_EDGE on both sides.
 
createFaceLoopFromCoordinatesAndMasks(graph: HalfEdgeGraph, data: LineStringDataVariant, returnPositiveAreaLoop: boolean, maskForBothSides: HalfEdgeMask, maskForOtherSide: HalfEdgeMask): HalfEdge | undefined Static create a circular doubly linked list of internal and external nodes from polygon points.  
createTriangulatedGraphFromLoops(loops: GrowableXYZArray[] | XAndY[][]): HalfEdgeGraph | undefined Static * Only one outer loop permitted.  
createTriangulatedGraphFromPoints(points: Point3d[]): HalfEdgeGraph | undefined Static Create a graph with a triangulation points.  
createTriangulatedGraphFromSingleLoop(data: XAndY[] | GrowableXYZArray): HalfEdgeGraph Static Triangulate the polygon made up of by a series of points.  
directCreateChainsFromCoordinates(graph: HalfEdgeGraph, data: MultiLineStringDataVariant, id: number = 0): HalfEdge[] Static Create chains from coordinates.  
directCreateFaceLoopFromCoordinates(graph: HalfEdgeGraph, data: LineStringDataVariant): HalfEdge | undefined Static Create a loop from coordinates.  
flipTriangles(graph: HalfEdgeGraph): number Static Visit each node of the graph array
If a flip would be possible, test the results of flipping using incircle condition
* If revealed to be an improvement, conduct the flip, mark involved nodes as unvisited, and repeat until all nodes are visited
 
triangulateAllPositiveAreaFaces(graph: HalfEdgeGraph): void Static Triangulate all positive area faces of a graph.  
triangulateSingleMonotoneFace(graph: HalfEdgeGraph, start: HalfEdge): boolean Static Triangulate a single face with (linear time) logic applicable only if the lowNode is the lowest node.  

Defined in

Last Updated: 20 September, 2019