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 ¶
type Point r2.Point
Point is a float64 2d point used in Delaunay triangulation.
func ConvexHull ¶
func ConvexHull(points []Point) []Point
ConvexHull returns the convex hull of the provided points.
type Triangulation ¶
type Triangulation struct {
Points []Point
ConvexHull []Point
Triangles []int
Halfedges []int
}
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.
Click to show internal directories.
Click to hide internal directories.