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

exception in polygon.cpp #144

Closed
makc opened this issue Jun 24, 2022 · 4 comments
Closed

exception in polygon.cpp #144

makc opened this issue Jun 24, 2022 · 4 comments

Comments

@makc
Copy link
Contributor

makc commented Jun 24, 2022

As discussed previously, here is example input leading to:

Error in file: ...\manifold\polygon\src\polygon.cpp (599): 'skipped.empty() || !vert->IsPast(skipped.back(), precision_)' is false: Not Geometrically Valid! None of the skipped verts is valid.

a.obj:

v 0.000000 0.000000 0.000000
v 0.000000 230.000000 0.000000
v -1630.000000 230.000000 0.000000
v -1400.000000 0.000000 0.000000
v 0.000000 0.000000 -2143.000000
v -1630.000000 230.000000 -2143.000000
v 0.000000 230.000000 -2143.000000
v -1400.000000 0.000000 -2143.000000
f 1 2 3
f 3 4 1
f 5 6 7
f 6 5 8
f 7 3 2
f 7 6 3
f 6 4 3
f 6 8 4
f 8 1 4
f 8 5 1
f 5 2 1
f 5 7 2

b.obj:

v -1185.000000 -70.000000 -2143.000000
v -305.000000 -70.000000 -2143.000000
v -1185.000000 -70.000000 0.000000
v -305.000000 -70.000000 0.000000
v -1185.000000 15320.000000 0.000000
v -305.000000 15320.000000 -2143.000000
v -1185.000000 15320.000000 -2143.000000
v -305.000000 15320.000000 0.000000
v -1185.000000 460.000000 0.000000
v -305.000000 460.000000 0.000000
v -1185.000000 460.000000 -2143.000000
v -305.000000 460.000000 -2143.000000
v -1185.000000 160.000000 -2143.000000
v -305.000000 160.000000 0.000000
v -1185.000000 160.000000 0.000000
v -305.000000 160.000000 -2143.000000
f 1 2 3
f 4 3 2
f 5 6 7
f 6 5 8
f 3 7 1
f 5 7 3
f 4 5 3
f 8 5 4
f 2 8 4
f 6 8 2
f 1 6 2
f 7 6 1
f 9 10 11
f 12 11 10
f 13 14 15
f 14 13 16
f 11 15 9
f 13 15 11
f 12 13 11
f 16 13 12
f 10 16 12
f 14 16 10
f 9 14 10
f 15 14 9

here is what they look like:
a.obj
b.obj

the exception happens when we try to get the result of a - b.

@makc
Copy link
Contributor Author

makc commented Jun 24, 2022

I assume there is a problem in b's bottom area, where some small triangles seem to sit on top of large ones 🤔 despite this mesh passing manifold test.

@makc
Copy link
Contributor Author

makc commented Jun 24, 2022

Looking at it further, it is actually whole 2nd box there:
image

I guess it boils down to what you said here:

I don't currently make any guarantees about handling self-overlapping input meshes, and I don't have an efficient way to test for them either. I would like to make an algorithm to fix these, but that'll take considerable time. Until then, general input meshes aren't going to be safe.

@elalish
Copy link
Owner

elalish commented Jun 24, 2022

Indeed, you are correct. I really need at least a decent self-overlap checker method. I might just turn that exception into one that says: "self-overlapping input detected, which is not supported". I only haven't because it's possible it could also be a legit bug, though I haven't found any recently.

@makc
Copy link
Contributor Author

makc commented Jun 24, 2022

I guess I will close this one since it has to be fixed on web-ifc side.

@makc makc closed this as completed Jun 24, 2022
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