OCCCurve2d.closest_point

OCCCurve2d.closest_point(point, return_parameter=False)

Compute the closest point on the curve to a given point.

Parameters:
pointcompas.geometry.Point

The test point.

return_parameterbool, optional

If True, the parameter corresponding to the closest point should be returned in addition to the point.

Returns:
compas.geometry.Point | tuple[compas.geometry.Point, float]

If return_parameter is False (default), only the closest point is returned. If return_parameter is True, the closest point and the corresponding parameter are returned.