Closest Point to the nearest Parameter at Point, then Shortest Distance

I have a series of curves and have populated points at parameter and wish to know the closest distance a series of internal points are to the nearest adjacent points at parameter. Having no luck getting this to work. Any suggestions welcomed.

You can see a post in Geometry-Closet-And-Geometry-Working-Range with some scripts :

def calculate_distance(p1, p2):
    return ((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)**0.5
  
def find_nearest_point(start_point, points):
    min_distance = math.inf
    index = 0
    for i, point in enumerate(points):
        distance = calculate_distance(start_point, point)
        if min_distance > distance:
            min_distance = distance
            index = i
    if points:
        next_point = points.pop(index)
        stack.append(next_point)
        find_nearest_point(next_point, points)
1 Like

Many thanks.

I am afraid l am not understanding :upside_down_face: