PolyCurve

class rhino3dm.PolyCurve
PolyCurve()

PolyCurve constructor

SegmentCount

int: Gets the number of segments that make up this Polycurve.

IsNested

bool: Gets a value indicating whether or not a PolyCurve contains nested PolyCurves.

HasGap

bool: This is a quick way to see if the curve has gaps between the sub curve segments.

SegmentCurve(index)

Gets the segment curve at the given index.

Parameters:

index (int) – Index of segment to retrieve.

Returns:

The segment at the given index or None on failure.

Return type:

rhino3dm.Curve

RemoveNesting()

Explodes nested polycurve segments and reconstructs this curve from the shattered remains. The result will have not have any PolyCurves as segments but it will have identical locus and parameterization.

Returns:

True if any nested PolyCurve was found and absorbed, False if no PolyCurve segments could be found.

Return type:

bool

Explode()

Explodes this PolyCurve into a list of Curve segments. This will not explode nested polycurves. Call first if you need all individual segments.

Returns:

An array of polycurve segments.

Return type:

rhino3dm.Curve[]

Append(line)

Appends and matches the start of the line to the end of polycurve. This function will fail if the polycurve is closed.

Parameters:

line (Line) – Line segment to append.

Returns:

True on success, False on failure.

Return type:

bool

Append(arc)

Appends and matches the start of the line to the end of polycurve. This function will fail if the polycurve is closed.

Parameters:

line (Line) – Line segment to append.

Returns:

True on success, False on failure.

Return type:

bool

Append(curve)

Appends and matches the start of the line to the end of polycurve. This function will fail if the polycurve is closed.

Parameters:

line (Line) – Line segment to append.

Returns:

True on success, False on failure.

Return type:

bool

AppendSegment(curve)

Appends the curve to the polycurve without changing the new segment’s geometry. This function will fail if the PolyCurve is closed or if SegmentCount > 0 and the new segment is closed.

Parameters:

curve (rhino3dm.Curve) – Segment to append.

Returns:

True on success, False on failure.

Return type:

bool

SegmentCurveParameter(polycurveParameter)

Converts a polycurve parameter to a segment curve parameter.

Parameters:

polycurveParameter (float) – Parameter on PolyCurve to convert.

Returns:

Segment curve evaluation parameter or UnsetValue if the segment curve parameter could not be computed.

Return type:

float

PolyCurveParameter(segmentIndex, segmentCurveParameter)

Converts a segment curve parameter to a polycurve parameter.

Parameters:
  • segmentIndex (int) – Index of segment.

  • segmentCurveParameter (float) – Parameter on segment.

Returns:

Polycurve evaluation parameter or UnsetValue if the polycurve curve parameter could not be computed.

Return type:

float

SegmentDomain(segmentIndex)

Returns the polycurve sub-domain assigned to a segment curve.

Parameters:

segmentIndex (int) – Index of segment.

Returns:

The polycurve sub-domain assigned to a segment curve. Returns Interval.Unset if segment_index < 0 or segment_index >= Count().

Return type:

rhino3dm.Interval

SegmentIndex(polycurveParameter)

Finds the segment used for evaluation at polycurve_parameter.

Parameters:

polycurveParameter (float) – Parameter on polycurve for segment lookup.

Returns:

Index of the segment used for evaluation at polycurve_parameter. If polycurve_parameter < Domain.Min(), then 0 is returned. If polycurve_parameter > Domain.Max(), then Count()-1 is returned.

Return type:

int