Copyright © 2021 by K4.org
  (v.0.48.124)

Hierarchy

Index

Properties

Readonly convexHull2D

convexHull2D: function

Returns the convex hull of the given points. The hull points are ordered around the perimeter as a polygon. This assumes the points are in the XY plane.

Readonly delaunay

delaunay: function

Returns the Delaunay Triangulation of the set of points given. The triangulation is returned as an array of triples of indices into the provided points array, such that [1, 2, 3] is the triangle defined by points[1], points[2], and points[3].

param

List of points to triangulate.

Readonly triangulatePolygon

triangulatePolygon: function

Triangulates the polygon given by boundary (and optional holes), each of which is a list of Points (where holes is itself a list of such polygons). To perform the computation, the points are "flattened" to 2d based on the plane of the first 3 non- collinear points. The resulting vertices, however, are the same as those passed in. Although not required, it is recommended that the boundary points circulate counter- clockwise around the face when view from the outside, and holes circulate clockwise.

param

The outside boundary polygon.

param

An optional list of hole polygons.

returns

A MeshData object, consisting of a list of vertices and a list of faces, using three.js Vector3 and Face3 types, respectively. This is compatible with other MeshData used in other objects. However, it does not include UV mapping or vertex normals.