AngusJohnson / Clipper2

Polygon Clipping and Offsetting - C++, C# and Delphi
Boost Software License 1.0
1.34k stars 248 forks source link

Empty polytree when taking the union of 3 closed polygons. #857

Closed JohanDelvaux closed 3 weeks ago

JohanDelvaux commented 3 weeks ago

I am getting an empty polytree when uniting 3 closed polygons. They should all be positively oriented. I added the 3 polygons in attachment. Breaking on all exceptions I see the call stack in attachment.

I am using the Clipper2 version 1.3.0 nuget package.

CallStack Poly99.txt SideStart0_SideEnd1_Simple0.txt SideStart2_SideEnd0_Simple0.txt

The code is basically this:

var clipper = new ClipperD(5); clipper.AddSubject(clipperPoly1); clipper.AddSubject(clipperPoly2); clipper.AddSubject(clipperPoly3); var polyTree = new PolyTreeD(); clipper.Execute(ClipType.Union, FillRule.Positive, polyTree);

JohanDelvaux commented 3 weeks ago

Also added an screenshot of the polygons in attachment. Preview

AngusJohnson commented 3 weeks ago

I am using the Clipper2 version 1.3.0 nuget package.

Use the latest version from the repository here.

JohanDelvaux commented 3 weeks ago

Are the nuget packages managed by you? It would be far less work if a new nuget package would be released (for all people using the nuget package I think)

AngusJohnson commented 3 weeks ago

Are the nuget packages managed by you?

Yes, it is managed by me.

However Johan, you may not realise that I do this as a hobby and have a very busy life apart from programming. So I have to prioritise what I do. And my assumption is that if open source software isn't working as expected, then most people would check that they have the most recent version before raising a support request 😉.

JohanDelvaux commented 2 weeks ago

Hello Angus,

I have checked on the latest version of the main branch in github now and indeed it works.

I am very sorry if you actually spent time verifying the same thing. I could indeed have done that before contacting you. (I actually did a real effort to provide you with a reasonably simple reproducible example, but I agree that I could have gone one step further).

I hope you can appreciate that to the outside (C#) world, it is actually the latest released nuget package that is of main interest. Without following the development here in detail, this is the version of which we can be reasonably sure that it is stable.

Do you have plans to create a new nuget package shortly? I notice that the latest nuget package dates from november last year and that there have been numerous bugfixes that could be of interest to the community.

I could of course start to build nuget packages from the main branch here and version them for my purpose only, but then I have no idea whether it will be a stable version, and also the versioning will then deviate / intertwine with the official version that you create, which actually I really would like to avoid.

I would like to end with saying that this is an amazing library. It's really fantastic that you share this as an open source project. This is actually the very first time that I encountered an issue with it (and in fact that issue has been resolved already in the main branch).

Best regards, Johan

AngusJohnson commented 2 weeks ago

Hi again Johan. Thank you for your very kind words and encouragement. Much appreciated. And I'm sorry if my reply was a little terse. I often find it difficult getting the tone right.

Do you have plans to create a new nuget package shortly?

It's very much on my todo list and why I've left an open issue about this. But no time frame, possibly a week or two.