Decide if it makes sense to close off the curve by moving the endpoint to the start based on start-end gap size and length of curve as approximated by chord defined by 6 points.
rhinoscriptsyntax.IsCurveClosable (curve_id, tolerance=None)
rhinoscript.curve.IsCurveClosable (curve_id, tolerance=None)
curve_id |
Required. String or Guid. The object's identifier. |
tolerance |
Optional. Number. The maximum allowable distance between start point and end point of the curve. If omitted, the document's current absolute tolerance is used. |
Boolean |
True if successful, otherwise False. |
None |
On error. |
import rhinoscriptsyntax as rs
crv = rs.GetObject("Select curve", rs.filter.curve)
if not rs.IsCurveClosed(crv) and rs.IsCurveClosable(crv):
rs.CloseCurve( crv, 0.1 )