pvigier / Quadtree

A simple and modern C++ quadtree implementation
https://pvigier.github.io/2019/07/28/quadtree-collision-detection.html
MIT License
210 stars 32 forks source link

Find 2D point in quadrilateral collection ? #11

Open nyue opened 9 months ago

nyue commented 9 months ago

I have a collection (10,000s) of 2d quadrilateral shapes/polygon

I have a collection (millions) of 2d points

I would like to know if this library is suitable for me quickly find (for each 2d point) which quadrilateral it intersects/bounds with or possibly no intersection at all.

If it is possible, which example or function call would you recommend I focus on to study deeper ?

brmarkus commented 4 months ago

Interesting question. @pvigier are you online, still supporting this repository?

pvigier commented 4 months ago

By quadrilateral, you mean a rectangle or any quadrilateral?

In any case, you should use an algorithm similar to findAllIntersections to do that efficiently. I guess you can represent points with boxes with zero height and width and try to use it as it is.