Calling the difference function did not yield the correct result #500
-
I would like to start with saying thank you for the great library. I encountered a problem while calling the difference function. The code is as follows: Clipper2Lib::PathD temp; The purpose of the code is to subtract the closed path temp1 from the closed path temp, resulting in res2 having only one closed path with a set of points {7, 6,4,5,3,6}. The actual difference result should also have a closed path {11,3,12,11,5}, but the program did not obtain this result. What is the reason for this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Your problem is simply due to rounding. Just scale all your coordinates up by a factor of 10 (or whatever). |
Beta Was this translation helpful? Give feedback.
-
You're absolutely right, there is a problem here. |
Beta Was this translation helpful? Give feedback.
-
In clipper.engine.cpp @ 1525ff, amend (as shown) the last line of the following method:
|
Beta Was this translation helpful? Give feedback.
In clipper.engine.cpp @ 1525ff, amend (as shown) the last line of the following method: