diff options
-rw-r--r-- | chroma/bvh/__init__.py | 2 | ||||
-rw-r--r-- | chroma/bvh/bvh.py (renamed from chroma/bvh.py) | 0 | ||||
-rw-r--r-- | chroma/bvh/grid.py | 19 | ||||
-rw-r--r-- | test/test_bvh.py | 2 |
4 files changed, 22 insertions, 1 deletions
diff --git a/chroma/bvh/__init__.py b/chroma/bvh/__init__.py new file mode 100644 index 0000000..fa3d476 --- /dev/null +++ b/chroma/bvh/__init__.py @@ -0,0 +1,2 @@ +from chroma.bvh.bvh import * +from chroma.bvh.grid import make_recursive_grid_bvh diff --git a/chroma/bvh.py b/chroma/bvh/bvh.py index d13d285..d13d285 100644 --- a/chroma/bvh.py +++ b/chroma/bvh/bvh.py diff --git a/chroma/bvh/grid.py b/chroma/bvh/grid.py new file mode 100644 index 0000000..9fcf125 --- /dev/null +++ b/chroma/bvh/grid.py @@ -0,0 +1,19 @@ +from chroma.bvh.bvh import BVH + +def make_recursive_grid_bvh(self, mesh, bits=11): + '''Returns a binary tree BVH created using a 'recursive grid' method. + + This method is somewhat similar to the original Chroma BVH generator, + with a few adjustments: + * It is a strict binary tree, with dummy nodes inserted when + only one child is required on an inner node. + * Every triangle is boxed individually by a leaf node in the BVH + * Triangles are not rearranged in Morton order since the + leaf nodes are sorted instead. + * The GPU is used to assist in the calculation of the tree to + speed things up. + + ''' + pass + + diff --git a/test/test_bvh.py b/test/test_bvh.py index 5372f6e..b90b108 100644 --- a/test/test_bvh.py +++ b/test/test_bvh.py @@ -1,5 +1,5 @@ import unittest -from chroma.bvh import BVH, BVHLayerSlice, WorldCoords, uint4, \ +from chroma.bvh.bvh import BVH, BVHLayerSlice, WorldCoords, uint4, \ OutOfRangeError, unpack_nodes import numpy as np from numpy.testing import assert_array_max_ulp, assert_array_equal, \ |