Skip to content

Suggestion: Make intersection callback delegate available if not using z #598

@SebastianDirks

Description

@SebastianDirks

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:

  1. Identify intersection points created by clipper during boolean operations
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions