Documentation
¶
Index ¶
- func ConformingDelaunay(pts [][2]float64, segs [][2]int32, holes [][2]float64) ([][2]float64, [][3]int32)
- func ConstrainedDelaunay(pts [][2]float64, segs [][2]int32, holes [][2]float64) ([][2]float64, [][3]int32)
- func Delaunay(pts [][2]float64) [][3]int32
- func FreeTriangulateIO(t *triangulateIO)
- func NewOptions() *options
- func NewTriangulateIO() *triangulateIO
- func Triangulate(in *triangulateIO, opts *options, verbose bool) *triangulateIO
- func Voronoi(pts [][2]float64) ([][2]float64, [][2]int32, []int32, [][2]float64)
- type SegmentSplitting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConformingDelaunay ¶
func ConformingDelaunay(pts [][2]float64, segs [][2]int32, holes [][2]float64) ([][2]float64, [][3]int32)
ConformingDelaunay computes the true Delaunay triangulation of a planar straight line graph with the given vertices, edges and holes. New vertices (Steiner points) may be inserted to ensure that the resulting triangles are all Delaunay.
func ConstrainedDelaunay ¶
func ConstrainedDelaunay(pts [][2]float64, segs [][2]int32, holes [][2]float64) ([][2]float64, [][3]int32)
ConstrainedDelaunay computes the constrained Delaunay triangulation of a planar straight line graph with the given vertices, edges and holes. The given segments are retained as such in the traingulation, hence not all triangles are Delaunay.
func FreeTriangulateIO ¶
func FreeTriangulateIO(t *triangulateIO)
func NewOptions ¶
func NewOptions() *options
NewOptions returns a new options struct with default parameters
func NewTriangulateIO ¶
func NewTriangulateIO() *triangulateIO
func Triangulate ¶
func Triangulate(in *triangulateIO, opts *options, verbose bool) *triangulateIO
Triangulate is the closest wrapper to the C code and can be used for flexible needs. Flags, constraints and quality options can be set using the second argument. Holes and segments that must appear in the triangulation can be set using methods (SetSegments() and SetHoles()) in the input triangulateIO struct.
Note that FreeTriangulateIO() has to be called explicitly on the in and out to release the memory.
func Voronoi ¶
Voronoi computes the Voronoi diagram of a given set of points It returns a set of Voronoi vertices, a set of edges between the points, as well as infinite which can occur around the boundary (defined by rayOrigins which indexes into the vertices, and rayDirs which provides the direction).
Types ¶
type SegmentSplitting ¶
type SegmentSplitting uint8
const ( SplittingAllowed SegmentSplitting = 0 + iota NoSplittingInBoundary NoSplitting )