A helper class used to construct triangulated polygon meshes Allow to add padding and a specific depth value.

Closed polygon to be processed and converted to a mesh (array of points or PIXI Polygon)

Various options : normalizing, offsetting, add depth, ...

Properties

indices: number[] = []

Polygon mesh indices

options: Record<string, number | boolean>

Contains options to apply during the meshing process

vertices: number[] = []

Polygon mesh vertices

_defaultOptions: Record<string, number | boolean> = ...

Default options values

Methods

  • Execute the triangulation to create indices

    Parameters

    • geometry: Geometry

      A geometry to update

    Returns Geometry

    The resulting geometry

  • Convert a flat points array into a 2 dimensional ClipperLib path

    Parameters

    • poly: number[] | Polygon

      PIXI.Polygon or points flat array.

    • Optionaldimension: number = 2

      Dimension.

    Returns any

    The clipper lib path.