Suggestion: Make intersection callback delegate available if not using z #609
Replies: 4 comments
-
I'm not sure what you're suggesting. |
Beta Was this translation helpful? Give feedback.
-
I will try, here are some snippets in C#:
for the code calling the delegate:
for calls where intersections are created:
I'm not sure if I know enough to do all the other places where intersections are created. |
Beta Was this translation helpful? Give feedback.
-
I might actually be easier to simply remove the conditional compilation and always call SetZ (rename it?), and just have the different method implementations for calling the delegate, one with z and one without. |
Beta Was this translation helpful? Give feedback.
-
I'm not (yet) persuaded that there's more general interest in using this callback without requiring the Z compilation. |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions