Port Clipper1 OffsetPolygons() method to Clipper2 ClipperOffset class #154
-
First of all, thank you for this amazing library, Angus! I really appreciate the effort you've put into this. I am having some difficulty porting some (working great) Clipper1 code over to Clipper2. The code needs to turn a solid shape into an outline. This is done by creating an offset (inset, in this case), which becomes a hole in the original solid shape. Here is the original solid shape: Here is the shape with the offset hole from Clipper1: And here is the shape with the offset hole from Clipper2: It is unusual to discover such a beautiful mistake! I love the output from Clipper2, but it is not what is needed. To isolate the issue, I renamed the original Clipper class to "Clipper1", so I could go back and forth between the libraries by just changing the "1" to a "2" and back. However, there isn't an exact 1:1 correspondence with the libraries. The C# OffsetPolygons method from Clipper1 is:
The attempted port to Clipper2 is:
I can post other code, if it helps. Am I missing something somewhere? How can I create an exact port of that Clipper1 code? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
EndType.Polygon 😉. Lovely post and I'd say more except it's 3.30am and I'm back to sleep. |
Beta Was this translation helpful? Give feedback.
-
That worked perfectly!
I can't believe it was that simple. 🤦
Thank you!
…On Sat, Aug 6, 2022 at 1:23 PM Angus Johnson ***@***.***> wrote:
Am I missing something
EndType.Polygon 😉.
Lovely post and I'd say more except it's 3.30am and I'm back to sleep.
—
Reply to this email directly, view it on GitHub
<#154 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXJ2NPBQ2G4AWJNQME2JAVDVX2NRBANCNFSM55Y7G2LA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
EndType.Polygon 😉.
Lovely post and I'd say more except it's 3.30am and I'm back to sleep.