triangle

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 Delaunay

func Delaunay(pts [][2]float64) [][3]int32

Delaunay computes the unconstrained Delaunay triangulation of a given set of points

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

func Voronoi(pts [][2]float64) ([][2]float64, [][2]int32, []int32, [][2]float64)

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL