flo_curves icon indicating copy to clipboard operation
flo_curves copied to clipboard

[Feature request] Can there be functions to calculate point to curve distance?

Open shi-yan opened this issue 2 years ago • 1 comments

I have a feature request, if would be great if there are functions to calculate point to curve distance.

Thanks!

shi-yan avatar May 01 '22 17:05 shi-yan

I've added nearest_t(), nearest_point() and distance_to() functions to do this in the v0.7 branch. These all find the closest point using a Newton-Raphson search.

Note that t_for_point() and curve_intersects_ray() are other ways to find nearby points on the curve that can be used to compute distances from v0.6: they won't find the strictly closest point, but their behaviour is easier to predict for interactive applications.

Logicalshift avatar May 10 '22 22:05 Logicalshift