Divides a curve object into a specified number of segments.
rhinoscriptsyntax.DivideCurve (curve_id, segments, create_points=False, return_points=True)
rhinoscript.curve.DivideCurve (curve_id, segments, create_points=False, return_points=True)
curve_id |
Required. String or Guid. The object's identifier. |
segments |
Required. Number. The number of segments. |
create_points |
Optional. Boolean. Create the division points. If omitted or False, points are not created. |
return_points |
Optional. Boolean. Return an array of 3-D points. If omitted or True, points are returned. If False, then an array of curve parameters are returned. |
List of Point3d |
If return_points is not specified or True, then an array containing 3-D division points if successful. |
List of Numbers |
If return_points is False, then an array containing division curve parameters if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select a curve")
if obj:
points = rs.DivideCurve(obj, 4)
for point in points: rs.AddPoint(point)