I'm using clipper2 in C#. I understand that the reason for using conditional compilation for usingZ is the performance drawback of having structs with 3 longs instead of 2 for the points.
The use cases I currently require usingZ for are:
- Identify intersection points created by clipper during boolean operations
- Identfiy which source polygons were clipped to form an output polygon
Both use cases could also be easily solved using only the intersection callback delegte with X/Y points, using it to fill custom data structures. UsingZ might still be valid for some use cases were additional data needs to be referenced on point to point basis.
So my proposal is to make the z callback delegate available as well in the normal X/Y compilation, maybe calling it IntersectionDelegate? With it defaulting to null and doing nothing. The performance impact of the null check for the delegate should be minimal.
I'm using clipper2 in C#. I understand that the reason for using conditional compilation for usingZ is the performance drawback of having structs with 3 longs instead of 2 for the points.
The use cases I currently require usingZ for are:
Both use cases could also be easily solved using only the intersection callback delegte with X/Y points, using it to fill custom data structures. UsingZ might still be valid for some use cases were additional data needs to be referenced on point to point basis.
So my proposal is to make the z callback delegate available as well in the normal X/Y compilation, maybe calling it IntersectionDelegate? With it defaulting to null and doing nothing. The performance impact of the null check for the delegate should be minimal.