Function closestPointPoly

Returns the closest point on a polygon or polyline to a given point

  • Parameters

    • pts: Vec2[]

      points of the polygon

    • closed: boolean

      whether or not the polygon is closed

    • pt: Vec2

      the point

    Returns Vec2

    The closest point on the polygon or polyline