Octree-0.2.3: Simple unbalanced Octree for storing data about 3D points

Safe HaskellNone

Data.Octree

Synopsis

Documentation

data Octree a Source

Instances

dist :: Vector3 -> Vector3 -> DoubleSource

distance between two vectors

fromList :: [(Vector3, a)] -> Octree aSource

Creates an Octree from a list of (index, payload) tuples.

toList :: Octree t -> [(Vector3, t)]Source

Creates an Octree from list, trying to keep split points near centers | of mass for each subtree.

lookup :: Octree a -> Vector3 -> Maybe (Vector3, a)Source

Finds a given point, if it is in the tree.

insert :: (Vector3, a) -> Octree a -> Octree aSource

Inserts a point into an Octree. | NOTE: insert accepts duplicate points, but lookup would not find them - use withinRange in such case.

nearest :: Octree a -> Vector3 -> Maybe (Vector3, a)Source

Finds nearest neighbour for a given point.

withinRange :: Scalar -> Vector3 -> Octree a -> [(Vector3, a)]Source

Returns all points within Octree that are within a given distance from argument.