Documentation ¶
Overview ¶
Package poly2tri is a port of Poly2Tri to Go.
Index ¶
Constants ¶
View Source
const ( // PiOver2 is Pi/2. PiOver2 = math.Pi / 2 // Pi3Over4 is 3Pi/4. Pi3Over4 = 3 * math.Pi / 4 // Epsilon is a small number. Epsilon = 1e-12 )
View Source
const ( // CW is clockwise. CW = iota // CCW is counter-clockwise. CCW // COLLINEAR is collinear. COLLINEAR )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancingFront ¶
type AdvancingFront struct {
// contains filtered or unexported fields
}
AdvancingFront represents an advancing front.
type Basin ¶
type Basin struct {
// contains filtered or unexported fields
}
Basin represents a basin.
type EdgeEvent ¶
type EdgeEvent struct {
// contains filtered or unexported fields
}
EdgeEvent represents an edge event.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is an advancing front node.
type Point ¶
type Point struct {
X, Y float64
// contains filtered or unexported fields
}
Point represents a point.
type PointArray ¶
type PointArray []*Point
PointArray attaches the methods of Interface to []*Point, sorting in increasing order.
func (PointArray) Len ¶
func (p PointArray) Len() int
func (PointArray) Less ¶
func (p PointArray) Less(i, j int) bool
func (PointArray) Swap ¶
func (p PointArray) Swap(i, j int)
type SweepContext ¶
type SweepContext struct {
// contains filtered or unexported fields
}
SweepContext represents a sweep context.
func (*SweepContext) AddHole ¶
func (s *SweepContext) AddHole(polyline PointArray)
AddHole adds a hole.
func (*SweepContext) Mesh ¶
func (s *SweepContext) Mesh() TriArray
Mesh returns the entire triangle mesh for debugging purposes.
func (*SweepContext) RemoveFromMap ¶
func (s *SweepContext) RemoveFromMap(t *Triangle)
RemoveFromMap removes a triangle from the map.
func (*SweepContext) RemoveNode ¶
func (s *SweepContext) RemoveNode(node *Node)
RemoveNode removes a node.
func (*SweepContext) Triangulate ¶
func (s *SweepContext) Triangulate() TriArray
Triangulate returns the contstrained triangles.
Click to show internal directories.
Click to hide internal directories.