Trims a curve by removing portions of the curve outside the specified interval.
rhinoscriptsyntax.TrimCurve ( curve_id, interval, delete_input=True )
rhinoscript.curve.TrimCurve ( curve_id, interval, delete_input=True )
curve_id |
Required. String or Guid. The object's identifier. |
interval |
Required. Tuple of two numbers identifying the interval to keep. Portions of the curve before domain[0] and after domain[1] will be removed. If the input curve is open, the interval must be increasing. If the input curve is closed and the interval is decreasing, then the portion of the curve across the start and end of the curve is returned. |
delete_input |
Optional. Boolean. Delete the input curve. The default is to delete the input curve (True). |
Guid |
The identifier of the newly created curve object, if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
curve = rs.GetObject("Select a curve to trim", rs.filter.curve)
if rs.IsCurve(curve):
domain = rs.CurveDomain(curve)
domain[1] /= 2.0
rs.TrimCurve( curve, domain )