https://github.com/juliageometry/regiontrees.jl
Quadtrees, Octrees, and more in Julia
https://github.com/juliageometry/regiontrees.jl
Last synced: 6 months ago
JSON representation
Quadtrees, Octrees, and more in Julia
- Host: GitHub
- URL: https://github.com/juliageometry/regiontrees.jl
- Owner: JuliaGeometry
- License: other
- Created: 2016-12-03T02:58:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T16:54:11.000Z (almost 4 years ago)
- Last Synced: 2025-03-22T09:11:26.325Z (about 1 year ago)
- Language: Julia
- Homepage:
- Size: 1.21 MB
- Stars: 112
- Watchers: 5
- Forks: 22
- Open Issues: 6
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RegionTrees.jl: Quadtrees, Octrees, and their N-Dimensional Cousins
[](https://github.com/rdeits/RegionTrees.jl/actions?query=workflow%3ACI)
[](https://codecov.io/gh/rdeits/RegionTrees.jl)
This Julia package is a lightweight framework for defining N-Dimensional region trees. In 2D, these are called *region quadtrees*, and in 3D they are typically referred to as *octrees*. A region tree is a simple data structure used to describe some kind of spatial data with varying resolution. Each element in the tree can be a leaf, representing an N-dimensional rectangle of space, or a node which is divided exactly in half along each axis into 2^N children. In addition, each element in a `RegionTrees.jl` tree can carry an arbitrary data payload. This makes it easy to use `RegionTrees` to approximate functions or describe other interesting spatial data.
## Features
* Lightweight code with few dependencies (only `StaticArrays.jl` and `Iterators.jl` are required)
* Optimized for speed and for few memory allocations
* Liberal use of `@generated` functions lets us unroll most loops and prevent allocating temporary arrays
* Built-in support for general adaptive sampling techniques
## Usage
See [examples/demo/demo.ipynb](examples/demo/demo.ipynb) for a tour through the API. You can also check out:
* [examples/adaptive_distance_fields/adaptive_distances.ipynb](examples/adaptive_distance_fields/adaptive_distances.ipynb) for an adaptively-sampled distance field, or [AdaptiveDistanceFields.jl](https://github.com/rdeits/AdaptiveDistanceFields.jl) for a more complete example [1]
* [examples/adaptive_mpc/adaptive_mpc.ipynb](examples/adaptive_mpc/adaptive_mpc.ipynb) for an adaptive approximation of a model-predictive controller
[1] Frisken et al. "Adaptively Sampled Distance Fields: A General Representation of Shape for Computer Graphics". SIGGRAPH 2000.
## Gallery
An adaptively sampled distance field, from `examples/adaptive_distances.ipynb`:

An adaptively sampled model-predictive control problem, from `examples/adaptive_mpc.ipynb`:

An adaptive distance field in 3D, from [AdaptiveDistanceFields.jl](https://github.com/rdeits/AdaptiveDistanceFields.jl):

## Related Packages
* [Morton.jl](https://github.com/JaneliaSciComp/Morton.jl)
* [Interpolations.jl](https://github.com/JuliaMath/Interpolations.jl)