Documentation ¶
Index ¶
- Variables
- func Assert(condition bool, message string)
- func EdgeEventByEdge(tcx *SweepContext, edge *Edge, node *Node)
- func EdgeEventByPoints(tcx *SweepContext, ep *Point, eq *Point, triangle *Triangle, point *Point)
- func Fill(tcx *SweepContext, node *Node)
- func FillAdvancingFront(tcx *SweepContext, n *Node)
- func FillBasin(tcx *SweepContext, node *Node)
- func FillBasinReq(tcx *SweepContext, node *Node)
- func FillEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillLeftAboveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillLeftBelowEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillLeftConcaveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillLeftConvexEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillRightAboveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillRightBelowEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillRightConcaveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FillRightConvexEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
- func FinalizationPolygon(tcx *SweepContext)
- func FlipEdgeEvent(tcx *SweepContext, ep *Point, eq *Point, t *Triangle, p *Point)
- func FlipScanEdgeEvent(tcx *SweepContext, ep *Point, eq *Point, flip_triangle *Triangle, t *Triangle, ...)
- func InCircle(pa, pb, pc, pd *Point) bool
- func InScanArea(pa, pb, pc, pd *Point) bool
- func IsAngleObtuse(pa, pb, pc *Point) bool
- func IsBasinAngleRight(node *Node) bool
- func IsEdgeSideOfTriangle(triangle *Triangle, ep *Point, eq *Point) bool
- func IsShallow(tcx *SweepContext, node *Node) bool
- func Legalize(tcx *SweepContext, t *Triangle) bool
- func Orient2d(pa, pb, pc *Point) int
- func PointCompare(a, b *Point) float64
- func PointCross(a, b *Point)
- func PointDot(a, b XYInterface) float64
- func PointEquals(a, b *Point) bool
- func PointString(a *Point) string
- func RotateTrianglePair(t *Triangle, p *Point, ot *Triangle, op *Point)
- func SweepPoints(tcx *SweepContext)
- func Triangulate(tcx *SweepContext)
- func XYCompare(a, b XYInterface) float64
- func XYCompareFloat(a, b float64) float64
- func XYEquals(a, b XYInterface) bool
- func XYEqualsFloat(a, b float64) bool
- func XYString(a XYInterface) string
- type AdvancingFront
- func (af *AdvancingFront) FindSearchNode(x float64) *Node
- func (af *AdvancingFront) GetHead() *Node
- func (af *AdvancingFront) GetSearch() *Node
- func (af *AdvancingFront) GetTail() *Node
- func (af *AdvancingFront) LocateNode(x float64) *Node
- func (af *AdvancingFront) LocatePoint(point *Point) *Node
- func (af *AdvancingFront) SetHead(node *Node)
- func (af *AdvancingFront) SetSearch(node *Node)
- func (af *AdvancingFront) SetTail(node *Node)
- type Basin
- type Edge
- type EdgeEvent
- type Node
- type Point
- func (p *Point) Add(n XYInterface) *Point
- func (p *Point) Clone() *Point
- func (p *Point) Equals(p2 XYInterface) bool
- func (p *Point) GetX() float64
- func (p *Point) GetY() float64
- func (p *Point) Length() float64
- func (p *Point) Mul(n XYInterface) *Point
- func (p *Point) Negate() *Point
- func (p *Point) Normalize() float64
- func (p *Point) Set(x, y float64) *Point
- func (p *Point) SetZero() *Point
- func (p *Point) String() string
- func (p *Point) Sub(n XYInterface) *Point
- func (p *Point) ToJSON() string
- type SortablePointsCollection
- type SweepContext
- func (sc *SweepContext) AddHole(polyline []*Point) *SweepContext
- func (sc *SweepContext) AddHoles(holes [][]*Point) *SweepContext
- func (sc *SweepContext) AddPoint(point *Point) *SweepContext
- func (sc *SweepContext) AddPoints(points []*Point) *SweepContext
- func (sc *SweepContext) AddToMap(triangle *Triangle)
- func (sc *SweepContext) CreateAdvancingFront()
- func (sc *SweepContext) GetBoundingBox() (min *Point, max *Point)
- func (sc *SweepContext) GetFront() *AdvancingFront
- func (sc *SweepContext) GetHead() *Point
- func (sc *SweepContext) GetMap() []*Triangle
- func (sc *SweepContext) GetPoint(index int) *Point
- func (sc *SweepContext) GetTail() *Point
- func (sc *SweepContext) GetTriangles() []*Triangle
- func (sc *SweepContext) InitEdges(polyline []*Point)
- func (sc *SweepContext) InitTriangulation()
- func (sc *SweepContext) LocateNode(point *Point) *Node
- func (sc *SweepContext) MapTriangleToNodes(t *Triangle)
- func (sc *SweepContext) MeshClean(triangle *Triangle)
- func (sc *SweepContext) PointCount() int
- func (sc *SweepContext) RemoveFromMap(triangle *Triangle)
- func (sc *SweepContext) RemoveNode(node *Node)
- func (sc *SweepContext) SetHead(p1 *Point)
- func (sc *SweepContext) SetTail(p1 *Point)
- func (sc *SweepContext) Triangulate() *SweepContext
- type Triangle
- func (t *Triangle) ClearDelaunayEdges()
- func (t *Triangle) ClearNeighbors()
- func (t *Triangle) ContainsEdge(edge *Edge) bool
- func (t *Triangle) ContainsPoint(point *Point) bool
- func (t *Triangle) ContainsPoints(p1, p2 *Point) bool
- func (t *Triangle) EdgeIndex(p1 *Point, p2 *Point) int
- func (t *Triangle) GetConstrainedEdgeAcross(p *Point) bool
- func (t *Triangle) GetConstrainedEdgeCCW(p *Point) bool
- func (t *Triangle) GetConstrainedEdgeCW(p *Point) bool
- func (t *Triangle) GetDelaunayEdgeCCW(p *Point) bool
- func (t *Triangle) GetDelaunayEdgeCW(p *Point) bool
- func (t *Triangle) GetNeighbor(index int) *Triangle
- func (t *Triangle) GetPoint(index int) *Point
- func (t *Triangle) GetPoints(index int) []*Point
- func (t *Triangle) Index(p *Point) int
- func (t *Triangle) IsInterior() bool
- func (t *Triangle) Legalize(opoint *Point, npoint *Point)
- func (t *Triangle) MarkConstrainedEdgeByEdge(edge *Edge)
- func (t *Triangle) MarkConstrainedEdgeByIndex(index int)
- func (t *Triangle) MarkConstrainedEdgeByPoints(p, q *Point)
- func (t *Triangle) MarkNeighbor(tri *Triangle)
- func (t *Triangle) MarkNeighborPointers(p1, p2 *Point, tri *Triangle)
- func (t *Triangle) NeighborAcross(p *Point) *Triangle
- func (t *Triangle) NeighborCCW(p *Point) *Triangle
- func (t *Triangle) NeighborCW(p *Point) *Triangle
- func (t *Triangle) OppositePoint(tri *Triangle, p *Point) *Point
- func (t *Triangle) PointCCW(p *Point) *Point
- func (t *Triangle) PointCW(p *Point) *Point
- func (t *Triangle) SetConstrainedEdgeCCW(p *Point, ce bool)
- func (t *Triangle) SetConstrainedEdgeCW(p *Point, ce bool)
- func (t *Triangle) SetDelaunayEdgeCCW(p *Point, e bool)
- func (t *Triangle) SetDelaunayEdgeCW(p *Point, e bool)
- func (t *Triangle) SetInterior(interior bool) *Triangle
- func (t *Triangle) String() string
- type XYInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var EPSILON = 0.00001
View Source
var Orientation = map[string]int{
"CW": 1,
"CCW": -1,
"COLINEAR": 0,
}
Functions ¶
func EdgeEventByEdge ¶
func EdgeEventByEdge(tcx *SweepContext, edge *Edge, node *Node)
func EdgeEventByPoints ¶
func EdgeEventByPoints(tcx *SweepContext, ep *Point, eq *Point, triangle *Triangle, point *Point)
func Fill ¶
func Fill(tcx *SweepContext, node *Node)
func FillAdvancingFront ¶
func FillAdvancingFront(tcx *SweepContext, n *Node)
func FillBasin ¶
func FillBasin(tcx *SweepContext, node *Node)
func FillBasinReq ¶
func FillBasinReq(tcx *SweepContext, node *Node)
func FillEdgeEvent ¶
func FillEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillLeftAboveEdgeEvent ¶
func FillLeftAboveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillLeftBelowEdgeEvent ¶
func FillLeftBelowEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillLeftConcaveEdgeEvent ¶
func FillLeftConcaveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillLeftConvexEdgeEvent ¶
func FillLeftConvexEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillRightAboveEdgeEvent ¶
func FillRightAboveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillRightBelowEdgeEvent ¶
func FillRightBelowEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillRightConcaveEdgeEvent ¶
func FillRightConcaveEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FillRightConvexEdgeEvent ¶
func FillRightConvexEdgeEvent(tcx *SweepContext, edge *Edge, node *Node)
func FinalizationPolygon ¶
func FinalizationPolygon(tcx *SweepContext)
func FlipEdgeEvent ¶
func FlipEdgeEvent(tcx *SweepContext, ep *Point, eq *Point, t *Triangle, p *Point)
func FlipScanEdgeEvent ¶
func InScanArea ¶
func IsAngleObtuse ¶
func IsBasinAngleRight ¶
func IsEdgeSideOfTriangle ¶
func IsShallow ¶
func IsShallow(tcx *SweepContext, node *Node) bool
func Legalize ¶
func Legalize(tcx *SweepContext, t *Triangle) bool
func PointCompare ¶
func PointCross ¶
func PointCross(a, b *Point)
func PointDot ¶
func PointDot(a, b XYInterface) float64
func PointEquals ¶
func PointString ¶
func SweepPoints ¶
func SweepPoints(tcx *SweepContext)
func Triangulate ¶
func Triangulate(tcx *SweepContext)
func XYCompare ¶
func XYCompare(a, b XYInterface) float64
func XYCompareFloat ¶
func XYEquals ¶
func XYEquals(a, b XYInterface) bool
func XYEqualsFloat ¶
func XYString ¶
func XYString(a XYInterface) string
Types ¶
type AdvancingFront ¶
func NewAdvancingFront ¶
func NewAdvancingFront(head, tail *Node) *AdvancingFront
func (*AdvancingFront) FindSearchNode ¶
func (af *AdvancingFront) FindSearchNode(x float64) *Node
func (*AdvancingFront) GetHead ¶
func (af *AdvancingFront) GetHead() *Node
func (*AdvancingFront) GetSearch ¶
func (af *AdvancingFront) GetSearch() *Node
func (*AdvancingFront) GetTail ¶
func (af *AdvancingFront) GetTail() *Node
func (*AdvancingFront) LocateNode ¶
func (af *AdvancingFront) LocateNode(x float64) *Node
func (*AdvancingFront) LocatePoint ¶
func (af *AdvancingFront) LocatePoint(point *Point) *Node
func (*AdvancingFront) SetHead ¶
func (af *AdvancingFront) SetHead(node *Node)
func (*AdvancingFront) SetSearch ¶
func (af *AdvancingFront) SetSearch(node *Node)
func (*AdvancingFront) SetTail ¶
func (af *AdvancingFront) SetTail(node *Node)
type Basin ¶
type EdgeEvent ¶
func NewEdgeEvent ¶
func NewEdgeEvent() *EdgeEvent
type Node ¶
func NewFrontTriangle ¶
func NewFrontTriangle(tcx *SweepContext, point *Point, node *Node) *Node
func PointEvent ¶
func PointEvent(tcx *SweepContext, point *Point) *Node
type Point ¶
func PointNegate ¶
func (*Point) Add ¶
func (p *Point) Add(n XYInterface) *Point
func (*Point) Equals ¶
func (p *Point) Equals(p2 XYInterface) bool
func (*Point) Mul ¶
func (p *Point) Mul(n XYInterface) *Point
func (*Point) Sub ¶
func (p *Point) Sub(n XYInterface) *Point
type SortablePointsCollection ¶
type SortablePointsCollection []*Point
func (SortablePointsCollection) Len ¶
func (c SortablePointsCollection) Len() int
func (SortablePointsCollection) Less ¶
func (c SortablePointsCollection) Less(i, j int) bool
func (SortablePointsCollection) Swap ¶
func (c SortablePointsCollection) Swap(i, j int)
type SweepContext ¶
type SweepContext struct { Triangles []*Triangle Map []*Triangle Points []*Point EdgeList []*Edge PMin *Point PMax *Point Front *AdvancingFront Head *Point Tail *Point AfHead *Node AfMiddle *Node AfTail *Node Basin *Basin EdgeEvent *EdgeEvent }
func NewSweepContext ¶
func NewSweepContext(contour []*Point, cloneArrays bool) *SweepContext
func (*SweepContext) AddHole ¶
func (sc *SweepContext) AddHole(polyline []*Point) *SweepContext
func (*SweepContext) AddHoles ¶
func (sc *SweepContext) AddHoles(holes [][]*Point) *SweepContext
func (*SweepContext) AddPoint ¶
func (sc *SweepContext) AddPoint(point *Point) *SweepContext
func (*SweepContext) AddPoints ¶
func (sc *SweepContext) AddPoints(points []*Point) *SweepContext
func (*SweepContext) AddToMap ¶
func (sc *SweepContext) AddToMap(triangle *Triangle)
func (*SweepContext) CreateAdvancingFront ¶
func (sc *SweepContext) CreateAdvancingFront()
func (*SweepContext) GetBoundingBox ¶
func (sc *SweepContext) GetBoundingBox() (min *Point, max *Point)
func (*SweepContext) GetFront ¶
func (sc *SweepContext) GetFront() *AdvancingFront
func (*SweepContext) GetHead ¶
func (sc *SweepContext) GetHead() *Point
func (*SweepContext) GetMap ¶
func (sc *SweepContext) GetMap() []*Triangle
func (*SweepContext) GetPoint ¶
func (sc *SweepContext) GetPoint(index int) *Point
func (*SweepContext) GetTail ¶
func (sc *SweepContext) GetTail() *Point
func (*SweepContext) GetTriangles ¶
func (sc *SweepContext) GetTriangles() []*Triangle
func (*SweepContext) InitEdges ¶
func (sc *SweepContext) InitEdges(polyline []*Point)
func (*SweepContext) InitTriangulation ¶
func (sc *SweepContext) InitTriangulation()
func (*SweepContext) LocateNode ¶
func (sc *SweepContext) LocateNode(point *Point) *Node
func (*SweepContext) MapTriangleToNodes ¶
func (sc *SweepContext) MapTriangleToNodes(t *Triangle)
func (*SweepContext) MeshClean ¶
func (sc *SweepContext) MeshClean(triangle *Triangle)
func (*SweepContext) PointCount ¶
func (sc *SweepContext) PointCount() int
func (*SweepContext) RemoveFromMap ¶
func (sc *SweepContext) RemoveFromMap(triangle *Triangle)
func (*SweepContext) RemoveNode ¶
func (sc *SweepContext) RemoveNode(node *Node)
func (*SweepContext) SetHead ¶
func (sc *SweepContext) SetHead(p1 *Point)
func (*SweepContext) SetTail ¶
func (sc *SweepContext) SetTail(p1 *Point)
func (*SweepContext) Triangulate ¶
func (sc *SweepContext) Triangulate() *SweepContext
type Triangle ¶
type Triangle struct { Points []*Point Neighbors []*Triangle Interior bool ConstrainedEdge []bool DelaunayEdge []bool }
func NewTriangle ¶
func NextFlipTriangle ¶
func (*Triangle) ClearDelaunayEdges ¶
func (t *Triangle) ClearDelaunayEdges()
func (*Triangle) ClearNeighbors ¶
func (t *Triangle) ClearNeighbors()
func (*Triangle) ContainsEdge ¶
func (*Triangle) ContainsPoint ¶
func (*Triangle) ContainsPoints ¶
func (*Triangle) GetConstrainedEdgeAcross ¶
func (*Triangle) GetConstrainedEdgeCCW ¶
func (*Triangle) GetConstrainedEdgeCW ¶
func (*Triangle) GetDelaunayEdgeCCW ¶
func (*Triangle) GetDelaunayEdgeCW ¶
func (*Triangle) GetNeighbor ¶
func (*Triangle) IsInterior ¶
func (*Triangle) MarkConstrainedEdgeByEdge ¶
func (*Triangle) MarkConstrainedEdgeByIndex ¶
func (*Triangle) MarkConstrainedEdgeByPoints ¶
func (*Triangle) MarkNeighbor ¶
func (*Triangle) MarkNeighborPointers ¶
func (*Triangle) NeighborAcross ¶
func (*Triangle) NeighborCCW ¶
func (*Triangle) NeighborCW ¶
func (*Triangle) SetConstrainedEdgeCCW ¶
func (*Triangle) SetConstrainedEdgeCW ¶
func (*Triangle) SetDelaunayEdgeCCW ¶
func (*Triangle) SetDelaunayEdgeCW ¶
func (*Triangle) SetInterior ¶
type XYInterface ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.