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

Is the algorithm working? #4

Open
milasudril opened this issue Apr 10, 2023 · 2 comments
Open

Is the algorithm working? #4

milasudril opened this issue Apr 10, 2023 · 2 comments

Comments

@milasudril
Copy link

I have some trouble with "warning: property violated!"

I forked your repo so I could try to improve some things. I used commit milasudril@374f76e

I get an error when trying to compute the convex hull of the attached point cloud.
mesh.obj.gz

@Dung-Han-Lee
Copy link
Owner

Dung-Han-Lee commented Apr 11, 2023

It's been a long time since I worked on this. I think the warning that you're seeing came from these lines:

https://github.com/Dung-Han-Lee/Convexhull-3D-Implementation-of-incremental-convexhull-algorithm/blob/master/src/convexhull.cpp#L64-L72

When incrementally adding a new point, old faces that could be "illuminated" by the new point are removed. New faces are added between the remaining edges and the new point.

Consider a 3D pyramid shape with a new point above it, all four triangular faces are illuminated and removed. Now you're left with a square base. Four new faces would then be added between each edge of the square base and the new point.

Going back to your question: the assumption is, we must be adding new faces right next to an existing face. And the internal bookkeeping logic is to link the edges - between new and old face - to their new faces. If somehow an edge is linked to two faces, that means this edge is not associated with any illuminated faces, which violates the assumption.

This probably has to do with the hash collision you pointed out in a separate issue. Do you still see this error after modifying the hash function?

@milasudril
Copy link
Author

"This probably has to do with the hash collision you pointed out in a separate issue. Do you still see this error after modifying the hash function?"

Indeed, yes.

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

No branches or pull requests

2 participants