jianbaoxia
CAD master
Hi Bros, I got an axis (gp_Ax1), it's the axis of symmetry from a cylinder; and I also have a point.
I want to get the shortest distance from point to axis.
I have two ideas:
(1) create a line (gp_Lin) with the axis (gp_Ax1), and then find a tool to get the shortest distance.
However, I didn't find a tool to calculate the the shortest distance between line and point. (I find the
tool:GeomAPI_ProjectPointOnCurve, it can get the extrema between point and curve).
(2) get the local coordinate system from the cylinder, and converts the position of the point in global coordinate system to position in the local coordinate system, then can get the shortest distance easy.
However, I don't know how to complete it.
So I try to get help from you.
I want to get the shortest distance from point to axis.
I have two ideas:
(1) create a line (gp_Lin) with the axis (gp_Ax1), and then find a tool to get the shortest distance.
However, I didn't find a tool to calculate the the shortest distance between line and point. (I find the
tool:GeomAPI_ProjectPointOnCurve, it can get the extrema between point and curve).
(2) get the local coordinate system from the cylinder, and converts the position of the point in global coordinate system to position in the local coordinate system, then can get the shortest distance easy.
However, I don't know how to complete it.
So I try to get help from you.