Is there a Gcon command to check a line to a point?

Hello,

I just wanted to know if there was a similar command (like gcon) where i could check position continuity between a curve and a point…

Thank you in advance!

Best regards,
Julie

Hi Julie - Do you want to see if a point lies on a curve(?) use ClosestPoint - is that what you meant? Select the curve, start ClosestPoint and snap to the point - the distance is reported at the command line (subject to the Display Precision set in DocumentProperties > Units page.)

-Pascal

You want to see if the point lies on the curve? I guess the way with Rhino native tools would be to run ClosestPt command and first select the curve, then the point… If it says “0.00 units” or something that’s very tiny (less than file tolerance) then it effectively lies on the curve.

Or, you could use the following scriptlet:

import rhinoscriptsyntax as rs

def PointDistToCrv():
    crv=rs.GetObject("Select curve to test",4,preselect=True)
    if not crv: return
    pt=rs.GetObject("Select point to test",1)
    if not pt: return
    tol=rs.UnitAbsoluteTolerance()
    param=rs.CurveClosestPoint(crv,pt)
    pt_crv=rs.EvaluateCurve(crv,param)
    dist=rs.VectorLength(pt_crv-rs.coerce3dpoint(pt))
    if dist<tol: desc=""
    else: desc=" not"
    print "Point is{} within file tolerance of curve. Dist={}".format(desc,dist)
PointDistToCrv()

HTH, --Mitch

Hello Pascal and Mitch,

Thank you both so very much for your quick and kind answers to my question. Your suggestion is exactly what I was looking for!

Much obliged!

Best Regards,
Julie

p.s. (Mitch, I am not knowledgeable about “scriptlets”…yet, but hopefully some time soon!..they sound…very advanced!)

Best Regards,
Julie