-
Notifications
You must be signed in to change notification settings - Fork 25
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
Crash when two polygons share the same vertex #10
Comments
Triangle ignores duplicate input vertices. This will cause a problem, if you reference such a vertex in the segmentlist. The .NET version is doing the same thing. It doesn't crash because the segments reference the vertex instances directly and not by an index array. Still, one of the segments that share the duplicate vertex will reference the ignored vertex, that is not part of the mesh (that means: it's not connected to any triangle and will have vertex type = UndeadVertex). Though this will work fine most of the time, it might lead to subtle bugs and should be documented somewhere, so thanks for bringing up the issue :-) |
Thanks for information. |
It's actually not what I thought. The original Triangle executable works fine with the following poly file:
So, the problem is in the
For the duplicate vertex, you'd expect Don't know when I get some time to look into this. The first thing to do would be:
|
According to https://en.wikipedia.org/wiki/Magic_number_(programming), 0xcdcdcdcd is uninitialized heap memory. Just checked: looks like compiling in Win32 release helped, but not in x64. |
In x64 release, I was able to fix it with additional check: |
Well, it's not really a fix, just a workaround. I think to fix the issue, you should look where
I'm not an expert at C, so please help me to understand: Anyway, I'll re-open the issue for now. |
I'm not expert in C too.
in divconqdelaunay function |
似乎可以修改behavior里边的 -j选项??? 关于重复顶点: wo80/Triangle#10 https://www.cs.cmu.edu/~quake/triangle.help.html
Triangle lib seems to crash when two polygons share the same vertex, e.g.:
{ { 0, 0 }, { 10, 0 }, { 10, 10 }, { 0, 10 } }
{ { 10, 10 }, { 15, 10 }, { 15, 15 }, { 10, 15 } }
I used the following params: pzB
However, .NET port is working in this case.
The text was updated successfully, but these errors were encountered: