Open conceptclear opened 3 years ago
Interesting, looking into this. If I can get rid of the hacky little epsilon perturbation, would be nice.
@conceptclear this doesn't fix the problem unfortunately. I added this, and removed the ugly fix in util.h - the problem returns.
Tried it on the problematic model from issue #7 and it still has holes along the edges.
I have tried this on my own computer and it could solve the problem as shown below: The origin model in https://github.com/Forceflow/cuda_voxelizer/issues/7 has been deleted from the server so that I am not sure whether it could solve it.
Could you make a PR with the exact changes?
OK, I have made a PR to dev
Here's the problem model. problem.zip
Hi,@Forceflow I have found the reason which caused the problem that you mentioned in util.h. In cpu_voxelizer.cpp Line 133 to Line 135 and voxelize.cu Line 131 to Line 133 The positions of z and x in these lines of code are wrong. The modified code could be
float d_xz_e0 = (-1.0f glm::dot(n_zx_e0, glm::vec2(v0.z, v0.x))) + glm::max(0.0f, info.unit.z n_zx_e0[0]) + glm::max(0.0f, info.unit.x n_zx_e0[1]); float d_xz_e1 = (-1.0f glm::dot(n_zx_e1, glm::vec2(v1.z, v1.x))) + glm::max(0.0f, info.unit.z n_zx_e1[0]) + glm::max(0.0f, info.unit.x n_zx_e1[1]); float d_xz_e2 = (-1.0f glm::dot(n_zx_e2, glm::vec2(v2.z, v2.x))) + glm::max(0.0f, info.unit.z n_zx_e2[0]) + glm::max(0.0f, info.unit.x * n_zx_e2[1]);
After modifying these codes, the problems mentioned in https://github.com/Forceflow/cuda_voxelizer/issues/7 should not happen again :)