Documentation ¶
Overview ¶
Package delaunay implements 2d Delaunay triangulation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Point ¶
Point is a float64 2d point used in Delaunay triangulation.
func ConvexHull ¶
ConvexHull returns the convex hull of the provided points.
type Triangulation ¶
Triangulation stores the points, convex hull, triangles and half edges from a Delaunay triangulation.
func Triangulate ¶
func Triangulate(points []Point) (*Triangulation, error)
Triangulate returns a Delaunay triangulation of the provided points.
func (*Triangulation) GetTriangles ¶
func (t *Triangulation) GetTriangles(pts3d []r3.Vector) [][]r3.Vector
GetTriangles returns a slice that has triangle ID as index, and points IDs as value.
func (*Triangulation) GetTrianglesPointsMap ¶
func (t *Triangulation) GetTrianglesPointsMap() map[int][]int
GetTrianglesPointsMap returns a map that had triangle ID as key, and points IDs as value.
func (*Triangulation) Validate ¶
func (t *Triangulation) Validate() error
Validate performs several sanity checks on the Triangulation to check for potential errors. Returns nil if no issues were found. You normally shouldn't need to call this function but it can be useful for debugging.