Forceflow / cuda_voxelizer

CUDA Voxelizer to convert polygon meshes into annotated voxel grids
MIT License
583 stars 97 forks source link

postion calculation may be en error #66

Closed maidamai0 closed 2 years ago

maidamai0 commented 2 years ago

Hi, Thank you for this project, it helps me very much.

I found a small issue when calculating the voxel location here:

https://github.com/Forceflow/cuda_voxelizer/blob/b9521361dc0944dafaba88311142cb233b54f244/src/voxelize.cu#L176

I think it should be :

size_t location = static_cast<size_t>(x) + (static_cast<size_t>(y)* static_cast<size_t>(info.gridsize.x)) + (static_cast<size_t>(z)* static_cast<size_t>(info.gridsize.x)* static_cast<size_t>(info.gridsize.y));

since you made the info.gridsize.x == info.gridsize.y == info.gridsize.z when creating AABox we can't reproduce this issue. I found this by accident when experimenting the code and use a grid size with different value on three directions.

conceptclear commented 2 years ago

您好,您的邮件我已收到并会尽快回复,祝好

Forceflow commented 2 years ago

Fixed in release version. Thanks for the report!