Skip to content

perf(): return after first intersection #30

@ShaMan123

Description

@ShaMan123

I was thinking to enhance justCount to be returnType: 'intersection' | 'count' | 'intersects' while being backward compat with boolean.
If a consumer only needs the test that 2 paths intersect the method can return after the first hit.
Additionally I believe we could than employ another perf enhancement:
If 2 bboxex are tested and bbox1 contains a full axis of bbox2 while bbox2 contains the full counter axis of bbox1 we can assume that there must be an intersection.
Imagine the 2 bboxes creating a cross. Paths must intersect in the shared bbox (the cross' center)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions