rikrd / geomerative

Geomerative is a library for Processing. It extends 2D geometry operations to facilitate generative geometry. Includes a TrueType font and an SVG interpreters. This library exposes the shapes (such as vector drawings or typographies) in a more approchable way. Geomerative makes it easy to access the contours, the control points and the curve points, making it easy to develop generative typography and geometry pieces in Processing.
http://www.ricardmarxer.com/geomerative
GNU General Public License v3.0
176 stars 29 forks source link

Fast way to get the Style of a Child element which contains an RPoint? #14

Open cristianvogel opened 3 years ago

cristianvogel commented 3 years ago

What would be a fast way to find out the style belonging to a child group which contains a certain Point? At the moment all i can think of is to iterate through all the child elements, to match if it contains a point.

But this is very very slow, as I have 99000 points!

Am I missing a method that could do it for me?

rikrd commented 3 years ago

I'm guessing you want to first find the closest point to your query point and see to what child it belongs to. As you say, you must now iterate.

The only fast way I can think of, would be to perform some sort of quadtree on the points for querying. But that's not implemented in Geomerative, it's a quite specific use case.

On Sat, Mar 6, 2021 at 5:59 PM Cristian Vogel notifications@github.com wrote:

What would be a fast way to find out the style belonging to a child group which contains a certain Point? At the moment all i can think of is to iterate through all the child elements, to match if it contains a point.

But this is very very slow, as I have 99000 points!

Am I missing a method that could do it for me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rikrd/geomerative/issues/14, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADXXE72MWZCP5YBSUH65TTCJNNPANCNFSM4YW45JRQ .

-- ricard http://twitter.com/ricardmp http://www.ricardmarxer.com http://www.caligraft.com