The Closest point on curve without splitting or trimming the curves

Hi All,

Pls check the posted image…

Is it possible ??

You didn’t place this post in a specific category so I’m only able to base my answer on your picture…

Call ClosestPt, at the prompt select either the outer or the inner curve. At the base point prompt, select the point on the middle curve. That gives you what you want. Repeat for the other curve.

The ClosestPt command should do what you want if I understand correctly. Start the command, select one of the two inner/outer curves, Enter to confirm selection, then pick your blue point. A point should appear on the inner/outer curve that is the closest point to the pick point. Repeat for the other curve.

HTH, --Mitch

I want to make this possible using Rhino/VBscript.
It would be great if any one can post a sample script.

Something like the following should work:

Option Explicit
'Script by Mitch
'Version 1 August, 2015

Call FindClosestPointsSample()
Sub FindClosestPointsSample()
    
    Dim crvs,pt,crv
    crvs = Rhino.GetObjects("Select curves to check", 4,, True)
    If Not IsArray(crvs) Then Exit Sub
    
    pt = Rhino.GetPoint("Pick reference point")
    If Not IsArray(pt) Then Exit Sub
    
    Dim cparam,cpt
    Call Rhino.EnableRedraw(False)
    For Each crv In crvs
        cparam = Rhino.CurveClosestPoint(crv, pt)
        If Not IsNull(cparam) Then
            cpt = Rhino.EvaluateCurve(crv, cparam)
            If IsArray(cpt) Then
                Call Rhino.AddPoint(cpt)
            End If            
        End If    
    Next
    Call Rhino.EnableRedraw(True)
End Sub

You can pick multiple target curves with this script.

HTH, --Mitch

Thanx

Helvetosaur