Shortest distance between curve and point

Hello guys,

I am trying to deconstruct what’s under common how tools work. I was wondering how to compute the shortest distance between a curve and an arbitrary point in python without using any libraries.

Anyone could help me on this ?


Hi undoredo,

Is this what you are looking for:

succ, closest_t = crv.ClosestPoint(pt)
closest_pt = crv.PointAt(closest_t)

this might have your (partial) answer, but really, for most problems you can just google them and work on understanding the mathematics behind them and transfer them to code.

1 Like