From 5db9a0b51b93848c149d48c697f24c640bc33d4b Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Tue, 7 May 2013 09:40:39 -0400 Subject: Set dtype explicitly when making morton codes --- chroma/bvh/grid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chroma/bvh/grid.py b/chroma/bvh/grid.py index d8e1f38..6f4c146 100644 --- a/chroma/bvh/grid.py +++ b/chroma/bvh/grid.py @@ -68,7 +68,9 @@ def make_recursive_grid_bvh(mesh, target_degree=3): new_parent_morton_parts.extend([np.repeat(morton_part[0], len(extra_first)), morton_part[1:]]) - parent_morton_codes = np.concatenate(new_parent_morton_parts) + # Explicitly cast all lists to uint64 dtype to ensure final array has correct type + # (Empty array is implicitly float64 dtype) + parent_morton_codes = np.concatenate([p.astype(np.uint64) for p in new_parent_morton_parts]) first_child = np.concatenate(new_first_child_parts) nchild = np.ediff1d(first_child, to_end=nnodes - first_child[-1]).astype(np.uint32) -- cgit