Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis-aligned surfaces problem mentioned in util.h #48

Open
conceptclear opened this issue Nov 26, 2020 · 6 comments
Open

Axis-aligned surfaces problem mentioned in util.h #48

conceptclear opened this issue Nov 26, 2020 · 6 comments

Comments

@conceptclear
Copy link
Contributor

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 #7 should not happen again :)

@Forceflow Forceflow changed the title About the problem metioned in util.h Some axis-aligned surfaces problem mentioned in util.h Nov 27, 2020
@Forceflow Forceflow changed the title Some axis-aligned surfaces problem mentioned in util.h Axis-aligned surfaces problem mentioned in util.h Nov 27, 2020
@Forceflow
Copy link
Owner

Interesting, looking into this. If I can get rid of the hacky little epsilon perturbation, would be nice.

@Forceflow
Copy link
Owner

@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.

@conceptclear
Copy link
Contributor Author

I have tried this on my own computer and it could solve the problem as shown below:
Screenshot from 2020-12-03 16-35-57
Screenshot from 2020-12-03 16-36-46
The origin model in #7 has been deleted from the server so that I am not sure whether it could solve it.

@Forceflow
Copy link
Owner

Could you make a PR with the exact changes?

@conceptclear
Copy link
Contributor Author

OK, I have made a PR to dev

@Forceflow
Copy link
Owner

Here's the problem model.
problem.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants