Polyline

class rhino3dm.Polyline
Polyline()

Polyline constructor

Polyline(initialCapacity)

Initializes a new empty polyline with an initial capacity.

Parameters:initialCapacity (int) – Number of vertices this polyline can contain without resizing.
Polyline()

Polyline constructor

IsValid

bool: Gets a value that indicates whether this polyline is valid. Valid polylines have at least one segment, no Invalid points and no zero length segments.Closed polylines with only two segments are also not considered valid.

SegmentCount

int: Gets the number of segments for this polyline.

IsClosed

bool: Gets a value that indicates whether this polyline is closed. The polyline is considered to be closed if its start is identical to its endpoint.

Length

float: Gets the total length of the polyline.

IsClosedWithinTolerance(tolerance)

Determines whether the polyline is closed, provided a tolerance value.

Parameters:tolerance (float) – If the distance between the start and end point of the polyline is less than tolerance, the polyline is considered to be closed.
Returns:True if the polyline is closed to within tolerance, False otherwise.
Return type:bool
PointAt(t)

Gets the point on the polyline at the given parameter. The integer part of the parameter indicates the index of the segment.

Parameters:t (float) – Polyline parameter.
Returns:The point on the polyline at t.
Return type:rhino3dm.Point3d
TangentAt(t)

Gets the unit tangent vector along the polyline at the given parameter. The integer part of the parameter indicates the index of the segment.

Parameters:t (float) – Polyline parameter.
Returns:The tangent along the polyline at t.
Return type:rhino3dm.Vector3d
ClosesPoint(testPoint)

[todo] add documentation

ClosestParameter(testPoint)

Gets the parameter along the polyline which is closest to a test-point.

Parameters:testPoint (rhino3dm.Point3d) – Point to approximate.
Returns:The parameter along the polyline closest to testPoint.
Return type:float
ToNurbsCurve()

Constructs a nurbs curve representation of this polyline.

Returns:A Nurbs curve shaped like this polyline or None on failure.
Return type:rhino3dm.NurbsCurve
ToPolylineCurve()

Constructs a polyline curve representation of this polyline.

Returns:A curve shaped like this polyline or None on failure.
Return type:PolylineCurve
static CreateInscribedPolygon(circle, sideCount)

Create a regular polygon inscribed in a circle. The vertices of the polygon will be on the circle.

Parameters:
  • circle (Circle) – The circle.
  • sideCount (int) – The number of sides
Returns:

A closed polyline if successful, None otherwise.

Return type:

rhino3dm.Polyline

static CreateCircumscribedPolygon(circle, sideCount)

Create a regular polygon circumscribe about a circle. The midpoints of the polygon’s edges will be tangent to the circle.

Parameters:
  • circle (Circle) – The circle.
  • sideCount (int) – The number of sides
Returns:

A closed polyline if successful, None otherwise.

Return type:

rhino3dm.Polyline

static CreateStarPolygon(circle, radius, cornerCounts)

Create a regular star polygon. The star begins at circle.PointAt(0) and the vertices alternate between being on circle and begin on a concentric circle of other_radius.

Parameters:
  • circle (Circle) – The circle.
  • radius (float) – The radius of other circle.
  • cornerCount (int) – The number of corners on the circle. There will be 2*cornerCount sides and 2*cornerCount vertices.
Returns:

A closed polyline if successful, None otherwise.

Return type:

rhino3dm.Polyline