tree

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bounded

type Bounded interface {
	Bounds() tensor.Span3
}

type BoundedData

type BoundedData[B Bounded, V any] struct {
	Bounded B
	Data    V
}

func (BoundedData[B, V]) Bounds

func (b BoundedData[B, V]) Bounds() rtree.Bounding

type BoundingTree

type BoundingTree[B Bounded, V any] struct {
	rtree.Tree
}

func NewBoundingTree

func NewBoundingTree[B Bounded, V any](opts *rtree.Options) *BoundingTree[B, V]

func (*BoundingTree[B, V]) Insert

func (b *BoundingTree[B, V]) Insert(bounded B, data V)

func (*BoundingTree[B, V]) Overlaps

func (b *BoundingTree[B, V]) Overlaps(bounded Bounded) []BoundedData[B, V]

func (*BoundingTree[B, V]) Within

func (b *BoundingTree[B, V]) Within(bounded Bounded) []BoundedData[B, V]

type VertexData

type VertexData[V any] struct {
	Vertex tensor.Vec3
	Data   V
}

VertexData is a vertex and associated data.

type VertexDataSet

type VertexDataSet[V any] kdVertexDataSet[V]

VertexDataSet is a slice of (vertex, data) pairs used to construct a vertex tree.

func (VertexDataSet[V]) Append

func (s VertexDataSet[V]) Append(v tensor.Vec3, data V) VertexDataSet[V]

Append appends a (vertex, data) pair to the data set.

func (VertexDataSet[V]) AsTree

func (s VertexDataSet[V]) AsTree() VertexTree[V]

AsTree constructs a vertex tree from the data set.

type VertexTree

type VertexTree[V any] struct {
	*kdtree.Tree
}

A VertexTree is a k-d tree of (vertex, data) pairs.

func (VertexTree[V]) NearestSet

func (t VertexTree[V]) NearestSet(v tensor.Vec3, dist float64) []VertexData[V]

NearestSet returns (vertex, data) pairs within some distance of V.

Jump to

Keyboard shortcuts

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