← All ideas
  • Published 24 Apr 2024

Expose API for Vector Point Lookups & Intersections

Currently the Python API doesn't offer the ability to look up points without the use of expensive to cache kd-trees or slow selection sampling.

I personally have been able to write a few useful scripts, but they're tremendously slow due to the API limitations, I feel it'd be better if the end-user/dev didn't have to work hackily to get this to work.

So it'd be useful if intersections, possibly with an epsilon / distance vertex snapping factor can be used to return:

  • The intersection between the vector line parts of a GP line
  • The index and ref of the lines for each intersection

Bonus would be if the intersection query could be also processed in 2D projection as well as 3D.

Uses: By having access to intersection queries, developers can expand on this to make all kinds of features for both GP processing and GP to mesh/curve processing.

Secondly, it'd be nice if we are able to run also a simple point-based kd-tree style lookup based on distance factor and a limit count in the API. This would be an useful function in part to the raycast-y lookups aforementioned as currently the API forces us to do expensive and unreliable caching when there are a lot of strokes/points to look up spatially.

Thirdly, a query to use a "ray" as a query would be another helpful function, and runs off the same basis as intersections, only the developer is able to provide an arbitrary ray to get intersections in the GP stroke data with it.

Fourthly, a point-based lookup that uses a fill-type query to grab the enclosing stroke would be of additional usefulness.

100%

Development Status: Open

Upvote 2 Downvote 0
ayana
24 Apr 2024

0 Comments