-
Notifications
You must be signed in to change notification settings - Fork 61
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
Subtracting triangle from rectangle with WindingRule.Positive does not work as expected #54
Comments
Does this library support doubles? 4.495359229766127E-14 is basically zero but still isn't. Floating point numbers are a pain. |
Yes, there is a LibTessDotNet.Double which I actually used for this example. Thanks for mentioning this aspect. I will add this information to the original issue. |
Me and my company would be very much up helping/sponsoring in fixing this problem. It actually posses a proper issue for us. |
I think I came accross some similiar issues and it was something about the way the passed orientation is handled. I ended up orientating all my polygons before passing them into the Tess object and then just pass them with ContourOrientation.Original. |
@DanielLorrig I tried this and sadly it did not work. |
I took your vertices and converted them to float (as my wrapper class only works with floats) Rearranged the order of the vertices so that the rectangle is counterclockwise and the triangle is cw. Passed all of the contours with "ContourOrientation.Original" to libtess. The result is as expected - vertex a is not in the list anymore. Now the only difference that comes to my mind is that I used floats instead of doubles. Have you tried using floats and if so were your results the same? |
While using this awesome library me and my team came across this problem. The code is taken from a unit test that reproduces the issue. Executable code can be found under [TesselationProblemExample].(https://github.com/sqeezy/TesselationProblemExample).
LibTessDotNet.Double was used for this example.
I could not think of a reason why this operation does not work as expected. Even if some points of the triangle are outside of the rectangle, the shape should never be ignored completely.
The text was updated successfully, but these errors were encountered: