-
Notifications
You must be signed in to change notification settings - Fork 98
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
Wrong output of specific polygon #37
Comments
I noticed an error like this when moving to the current version of the library from an older version I've been using for years. I may or may not have "fixed" this version of the library at one point so as not to exhibit the bug. Here's my source code for a version of the library that doesn't create these diagonal artifacts. Note that this version does not support orientation reversal or the Delaunay feature. libtess2_source_without_triangle_bug.zip |
It appears my source code matches this commit: d7c34ac So the regression was introduced sometime afterwards. I'm particularly suspicious of a specific line change to sweep.c that changed a comparison from |
Hi Mikko
I'm a C++ developer from China. Thank you for contributing this great library.
However, I find something wrong when I draw a rectangle with a hole which has 2 coincident edges. The version is v1.0.2.
As shown below, When I draw a rectangle(0->1->2->3) with a hole(4->5->6->7). Line 56 coincides with Line 32, and Line 01 coincides with Line 47.
Forgive me that I can't attach my source code for some reason. My code like this:
After that, I find that
elemCount
is 3, and I calculate the output triangles bytriangleVerts
andtriangleElems
inTESS_POLYGONS
way. I get only 3 triangles:(0,5,3)(5,0,4)(2,7,1). After renderring, my output picture shown like this below. One triangle (2,7,6) is missing.
I'm confused and I've done many experiments. I find that this commit will cause my problem. I am sure about this. I would be very greatful if you can point the connection between this "<=" and my problem, Or maybe my code is wrong?
The text was updated successfully, but these errors were encountered: