This project implements and compares three different octree data structure implementations:
- Classic Octree - Traditional implementation using fixed-size arrays
- Hashmap-based Octree - Using hash maps for dynamic child node storage
- Morton Key-based Octree - Using Morton keys for spatial indexing
mkdir build
cd build
cmake ..
make./octree <tree_type> <distribution_type> <num_points>-
tree_type: The octree implementation to useclassic- Classic octree implementationhashmap- Hashmap-based octree implementationmorton- Morton key-based octree implementation
-
distribution_type: The pattern of points to generaterandom- Random points in 3D spacegrid- Points in a regular 3D gridspiral- Points in a 3D spiral pattern
-
num_points: Number of points to generate and insert
# Create a classic octree with 1000 random points
./octree classic random 1000
# Create a hashmap-based octree with 512 points in a grid
./octree hashmap grid 512
# Create a Morton key-based octree with 2000 points in a spiral
./octree morton spiral 2000When running, the octree is saved as a vtk grid, which can be opened with paraview for visualization