API / geotoolkit / util / DelaunayTriangulator / DelaunayTriangulator
util.DelaunayTriangulator.DelaunayTriangulator
Class for triangulation of points using Delaunay algorithm.<br> The triangulation methods used in this class are based on:<ul> <li>Implementation by Mapbox https://github.com/mapbox/delaunator, released under the ISC License</li> <li>Implementation by Paul Bourke ported to JS https://github.com/darkskyapp/delaunay-fast, released under public domain CC0 1.0 Licence</li> </ul> This algorithm triangulates a set of 2D points, and is also capable of triangulating 3D points on the XY plane (by ignoring Z values)<br>
Constructors
- [new DelaunayTriangulator()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.delaunaytriangulator.delaunaytriangulator.md#new delaunaytriangulator())
Methods
▸ getClassName(): string
string
▸ Static getClassName(): string
string
▸ Static triangulate(vertices, is2d?): number[]
Triangulate the given points using Delaunay algorithm.<br> Different algorithms will be used if providing: <ul><li> 2D points (and setting the "is2d" option to true) will use the so-called "Delaunator" implementation. Note that the Z coordinate will be ignored.<br> See https://github.com/mapbox/delaunator. </li><li> 3D points (default or setting the "is2d" option to false) will use the so-called "Delaunay-Fast" implementation.<br> See https://github.com/darkskyapp/delaunay-fast. </li></ul>
| Name | Type | Description |
|---|---|---|
vertices | number[] | vertices |
Optional is2d | boolean | if the given array contains 2 or 3 values per point, false by default. The 3rd coordinate (Z) is ignored, but a different algorithm is used. |
number[]
triangle indices in the form [t1p1,t1p2,t1p3, t2p1,t2p2,t2p3, etc].
▸ Static triangulateSurface(vertices3D, options?): number[]
Triangulate the given 3D points using Delaunay algorithm (2D triangulation, Z coordinates will be ignored), this version works best for non-ordered point sets (that do not follow a row or column order layout).<br> This triangulation will produce more accurate results if the given points form a convex shape (ideally), but if not, concave artifacts can be filtered with the filtergaps options.<br> Because this triangulation algorithm only takes into account X and Y coordinates, users may want to pre-filter the points, or filter the generated indexed triangles based on potentially invalid Z values to avoid 3D issues.<br> The implementation used for this triangulation is https://github.com/mapbox/delaunator.
| Name | Type | Description |
|---|---|---|
vertices3D | number[] | 3D vertices. |
Optional options | TriangulateSurface | the triangulation options. |
number[]
triangle indices in the form [t1p1,t1p2,t1p3, t2p1,t2p2,t2p3, etc].