Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Octree is a shallow tree structure for 3-dimensional points

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Data
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Octree.cabal
Octocat-spinner-32 README.lhs
Octocat-spinner-32 README.md
Octocat-spinner-32 Setup.hs
README.md

octree

This is a simple Octree implementation in Haskell.

Build Status

To use simply:

module Main where

import Data.Octree as O

import Data.Vector.V3

main = do let oct = fromList [(Vector3 1 2 3, "a"),
                              (Vector3 3 4 5, "b"),
                              (Vector3 8 8 8, "c")]
              report msg elt = putStrLn $ msg ++ show elt
          report "Nearest     :" $ O.nearest     oct     $ Vector3 2 2 3
          report "Within range:" $ O.withinRange oct 5.0 $ Vector3 2 2 3
          return ()

For now it uses AC-Vector package for vectors, but I may change it to use Tensor package used by OpenGL package, if there is interest. So far I still wait for package with vector operations (like dot, cross producton, vector projection and rejection) on Tensor types.

Official releases are on Hackage.

This package is also a part of Stackage - a stable subset of Hackage.

Something went wrong with that request. Please try again.