C#: usingZ variant not available via NuGet
It is currently not possible to use Clipper2 with the usingZ functionality enabled via the official NuGet channel. An unofficial package exists (https://packages.nuget.org/packages/Clipper2_usingZ ) but is outdated.
Because both variants share the same namespace and class names, the only way to use them together is assembly aliasing, which is cumbersome and does not propagate across dependency chains. A better approach would be to publish a separate package with a distinct namespace (e.g. Clipper2UsingZ), achieved via conditional compilation.
Use case:
- XY-only Vertex data is prefered in generel because it is smaller and faster, but sometimes Z data is required for specific algorithms.
- I have worked around this by renaming the namespace, building with USINGZ and publishing a USINGZ package to a private feed.
- I now plan to open source a geometry library that depends on Clipper2, so public NuGet availability of both variants would be very useful.
I can submit a PR with namespace conditional compilation if this seems acceptable. This would however be a breaking change for current USINGZ source builds. An alternative would be to keep main unchanged and maintain a separate branch for the usingZ variant release. That avoids breaking changes but complicates release workflow. It requires switching branches and merging main. In contrast, publishing via conditional compilation with package name overrides is easy to automate. I can assist with adapting release workflow scripts as well if desired.
If maintaining a usingZ package is not an option for you, I will solve this by publishing our internal build to NuGet instead as another unoffical package.
I can submit a PR with namespace conditional compilation if this seems acceptable.
I'm certainly interested to see this. And I suggest the new namespace be Clipper2ZLib (or Clipper2Z if you think the former might be confused with compression).
Hello Angus,
thank you for the feedback. I will go the route of the conditional compilation then and provide a PR. I will test Nuget deployment beforehand using my university's internal Nuget registry, I think I can manage that this week. Do you also want me to provide the updated deploy script? I'm using Powershell and dotnet CLI tools in our pipeline. I have not seen deployment scripts in this Repo, I can also just post the 5 lines here in the issue. Regarding namespace: Clipper2ZLib sounds very good to me, I don't think anybody would confuse it with ZLib with that prefix. I will use that.
Best Sebastian
Do you also want me to provide the updated deploy script?
Presuming this is the Nuget deploy script, then yes please 😁.
I have provided the PR and added the deploy script in the PR description. I tested it on a private package registry with Visual Studio 2022 and DOTNET8. Let me know if I should test or change anything else or if you have any further questions.
I've just uploaded to Nuget Clipper2 and Clipper2Z (ver 2.0.0)