Documentation ¶
Index ¶
- type Node
- type Trapezoid
- func (tr *Trapezoid) AsPoints() []geom.D2
- func (tr *Trapezoid) BotEdge() geom.FullEdge
- func (tr *Trapezoid) Copy() *Trapezoid
- func (tr *Trapezoid) DCELEdges() []*dcel.Edge
- func (tr *Trapezoid) GetNeighbors() (*Trapezoid, *Trapezoid, *Trapezoid, *Trapezoid)
- func (tr *Trapezoid) HasDefinedPoint(p geom.D3) bool
- func (tr *Trapezoid) Lefts(tr2 *Trapezoid)
- func (tr *Trapezoid) Rights(tr2 *Trapezoid)
- func (tr *Trapezoid) String() string
- func (tr *Trapezoid) TopEdge() geom.FullEdge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
A Node is a node in a tree structure for trapezoid map queries. It is structured so that each variety of Node is the same struct, but each has a different payload and query function.
func NewRoot ¶
func NewRoot() *Node
NewRoot returns a root node. There is only one root node. We use a root node to avoid having "if parent == nil, set this to root" checks in our map code.
func NewTrapNode ¶
NewTrapNode returns a leaf node holding a trapezoid
func TrapezoidalMap ¶
TrapezoidalMap converts a dcel into a version of itself split into trapezoids and a search structure to find a containing trapezoid in the map in response to a point location query.
func (*Node) DCEL ¶
DCEL converts the trapezoids in the node search structure into a DCEL. This algorithm does not work? Consider scrapping this and replacing it with encoding the trapezoids as an OFF structure and decoding the resulting OFF structure as a DCEL.
func (*Node) PointLocate ¶
PointLocate returns, from a given complex structure, which substructure that point falls into, if any. In the trapezoidal map, the query structure can be point-located on.
type Trapezoid ¶
type Trapezoid struct { Neighbors [4]*Trapezoid // contains filtered or unexported fields }
A Trapezoid is used when contstructing a Trapezoid map, and contains references to its neighbor trapezoids and the edges that border it.
func (*Trapezoid) BotEdge ¶
BotEdge returns a translation of tr's values to tr's bottom edge as a FullEdge
func (*Trapezoid) DCELEdges ¶
DCELEdges evaluates and returns the edges of a trapezoid as DCElEdges with initialized origins, prevs, and nexts.
func (*Trapezoid) GetNeighbors ¶
func (*Trapezoid) HasDefinedPoint ¶
HasDefinedPoint returns for a given Trapezoid whether or not any of the points on the Trapezoid's perimeter match the query point. We make an assumption here that there will be no edges who have vertices defined on other edges, aka that all intersections are represented through vertices.
func (*Trapezoid) Lefts ¶
Lefts is shorthand for setting both of tr's left neighbors to the same value.