Click or drag to resize
Polyline Class
Represents an ordered set of points connected by linear segments.

Polylines are closed if start and end points coincide.

Inheritance Hierarchy
SystemObject
  Rhino.CollectionsRhinoListPoint3d
    Rhino.CollectionsPoint3dList
      Rhino.GeometryPolyline

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.50000.0 (5.0.20693.0)
Syntax
[SerializableAttribute]
public class Polyline : Point3dList

The Polyline type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyBoundingBox
Even though this is a property, it is not a "fast" calculation. Every point is evaluated in order to get the bounding box of the list.
(Inherited from Point3dList.)
Public propertyCapacity
Gets or sets the total number of elements the internal data structure can hold without resizing.
(Inherited from RhinoListT.)
Public propertyCount
Gets the number of elements actually contained in the List.
(Inherited from RhinoListT.)
Public propertyFirst
Gets or sets the first item in the list. This is synonymous to calling List[0].
(Inherited from RhinoListT.)
Public propertyIsClosed
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.

Public propertyIsValid
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.

Public propertyItem
Gets or sets the element at the specified index.
(Inherited from RhinoListT.)
Public propertyLast
Gets or sets the last item in the list. This is synonymous to calling List[Count-1].
(Inherited from RhinoListT.)
Public propertyLength
Gets the total length of the polyline.
Public propertyNullCount
Gets the number of null references (Nothing in Visual Basic) in this list. If T is a ValueType, this property always return zero.
(Inherited from RhinoListT.)
Public propertySegmentCount
Gets the number of segments for this polyline.
Public propertyX
Returns an indexer with all X coordinates in this list.
(Inherited from Point3dList.)
Public propertyY
Returns an indexer with all Y coordinates in this list.
(Inherited from Point3dList.)
Public propertyZ
Returns an indexer with all Z coordinates in this list.
(Inherited from Point3dList.)
Top
Methods
  NameDescription
Public methodAdd(T)
Adds an object to the end of the List.
(Inherited from RhinoListT.)
Public methodCode exampleAdd(Double, Double, Double)
Adds a Point3d to the end of the list with given x,y,z coordinates.
(Inherited from Point3dList.)
Public methodAddRange(IEnumerableT)
Adds the elements of the specified collection to the end of the List.
(Inherited from RhinoListT.)
Public methodAddRange(IEnumerable)
Adds the elements of the specified collection to the end of the List.
(Inherited from RhinoListT.)
Public methodAsReadOnly
Constructs a read-only wrapper of this class.
(Inherited from RhinoListT.)
Public methodBinarySearch(T)
Searches the entire sorted List for an element using the default comparer and returns the zero-based index of the element.
(Inherited from RhinoListT.)
Public methodBinarySearch(T, IComparerT)
Searches the entire sorted List for an element using the specified comparer and returns the zero-based index of the element.
(Inherited from RhinoListT.)
Public methodBinarySearch(Int32, Int32, T, IComparerT)
Searches the entire sorted List for an element using the specified comparer and returns the zero-based index of the element.
(Inherited from RhinoListT.)
Public methodBreakAtAngles
Breaks this polyline into sections at sharp kinks. Closed polylines will also be broken at the first and last vertex.
Public methodCenterPoint
Compute the center point of the polyline as the weighted average of all segments.
Public methodClear
Removes all elements from the List.
(Inherited from RhinoListT.)
Public methodClosestIndex
Finds the index of the point that is closest to a test point in this list.
(Inherited from Point3dList.)
Public methodClosestParameter
Gets the parameter along the polyline which is closest to a test-point.
Public methodClosestPoint
Gets the point on the polyline which is closest to a test-point.
Public methodCollapseShortSegments
Collapses all segments until none are shorter than tolerance. This function is significantly slower than DeleteShortSegments, since it recursively operates on the shortest segment. When a segment is collapsed the end-points are placed in the center of the segment.
Public methodContains
Determines whether an element is in the List.
(Inherited from RhinoListT.)
Public methodConvertAllTOutput
Aggregates all results of a conversion function over this table into a new list.
(Inherited from RhinoListT.)
Public methodCopyTo(T)
Copies the entire List to a compatible one-dimensional array, starting at the beginning of the target array.
(Inherited from RhinoListT.)
Public methodCopyTo(T, Int32)
Copies the entire List to a compatible one-dimensional array, starting at the specified index of the target array.
(Inherited from RhinoListT.)
Public methodCopyTo(Int32, T, Int32, Int32)
Copies a range of elements from the List to a compatible one-dimensional array, starting at the specified index of the target array.
(Inherited from RhinoListT.)
Public methodDeleteShortSegments
Removes all points that are closer than tolerance to the previous point.

Start and end points are left intact.

Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExists
Determines whether the List contains elements that match the conditions defined by the specified predicate.
(Inherited from RhinoListT.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFind
Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodFindAll
Retrieves all the elements that match the conditions defined by the specified predicate.
(Inherited from RhinoListT.)
Public methodFindIndex(PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodFindIndex(Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodFindIndex(Int32, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the List that extends from the specified index to the last element.
(Inherited from RhinoListT.)
Public methodFindLast
Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodFindLastIndex(PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodFindLastIndex(Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodFindLastIndex(Int32, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodForEach
Performs the specified action on each element of the List.
(Inherited from RhinoListT.)
Public methodGetEnumerator
Constructs an enumerator that is capable of iterating over all items in this list.
(Inherited from RhinoListT.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRange
Constructs a shallow copy of a range of elements in the source List.
(Inherited from RhinoListT.)
Public methodGetSegments
Constructs an array of line segments that make up the entire polyline.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf(T)
Searches for the specified object and returns the zero-based index of the first occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodIndexOf(T, Int32)
Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the List that extends from the specified index to the last element.
(Inherited from RhinoListT.)
Public methodIndexOf(T, Int32, Int32)
Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the List that starts at the specified index and contains the specified number of elements.
(Inherited from RhinoListT.)
Public methodInsert
Inserts an element into the List at the specified index.
(Inherited from RhinoListT.)
Public methodInsertRange
Inserts the elements of a collection into the List at the specified index.
(Inherited from RhinoListT.)
Public methodIsClosedWithinTolerance
Determines whether the polyline is closed, provided a tolerance value.
Public methodLastIndexOf(T)
Searches for the specified object and returns the zero-based index of the last occurrence within the entire List.
(Inherited from RhinoListT.)
Public methodLastIndexOf(T, Int32)
Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the List that extends from the first element to the specified index.
(Inherited from RhinoListT.)
Public methodLastIndexOf(T, Int32, Int32)
Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the List that contains the specified number of elements and ends at the specified index.
(Inherited from RhinoListT.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPointAt
Gets the point on the polyline at the given parameter. The integer part of the parameter indicates the index of the segment.
Public methodReduceSegments
Constructs a reduction of this polyline by recursively removing the least significant segments.
Public methodRemapIndex
Remap an index in the infinite range onto the List index range.
(Inherited from RhinoListT.)
Public methodRemove
Removes the first occurrence of a specific object from the List.
(Inherited from RhinoListT.)
Public methodRemoveAll
Removes the all the elements that match the conditions defined by the specified predicate.
(Inherited from RhinoListT.)
Public methodRemoveAt
Removes the element at the specified index of the List.
(Inherited from RhinoListT.)
Public methodRemoveNulls
Removes all elements from the List that are null references (Nothing in Visual Basic). This function will not do anything if T is not a Reference type.
(Inherited from RhinoListT.)
Public methodRemoveRange
Removes a range of elements from the List.
(Inherited from RhinoListT.)
Public methodReverse
Reverses the order of the elements in the entire List.
(Inherited from RhinoListT.)
Public methodReverse(Int32, Int32)
Reverses the order of the elements in the specified range.
(Inherited from RhinoListT.)
Public methodSegmentAt
Gets the line segment at the given index.
Public methodSetAllX
Set all the X values for the points to a single value
(Inherited from Point3dList.)
Public methodSetAllY
Set all the Y values for the points to a single value
(Inherited from Point3dList.)
Public methodSetAllZ
Set all the Z values for the points to a single value
(Inherited from Point3dList.)
Public methodSmooth
Smoothens the polyline segments by averaging adjacent vertices. Smoothing requires a polyline with exclusively valid vertices.
Public methodSort
Sorts the elements in the entire List using the default comparer.
(Inherited from RhinoListT.)
Public methodSort(IComparerT)
Sorts the elements in the entire list using the specified System.Comparison(T)
(Inherited from RhinoListT.)
Public methodSort(ComparisonT)
Sorts the elements in the entire list using the specified comparer.
(Inherited from RhinoListT.)
Public methodSort(Double)
Sort this list based on a list of numeric keys of equal length. The keys array will not be altered.
(Inherited from RhinoListT.)
Public methodSort(Int32)
Sort this list based on a list of numeric keys of equal length. The keys array will not be altered.
(Inherited from RhinoListT.)
Public methodSort(Int32, Int32, IComparerT)
Sorts the elements in a range of elements in list using the specified comparer.
(Inherited from RhinoListT.)
Public methodTangentAt
Gets the unit tangent vector along the polyline at the given parameter. The integer part of the parameter indicates the index of the segment.
Public methodToArray
Constructs an array that contains all items in this list.
(Inherited from RhinoListT.)
Public methodToNurbsCurve
Constructs a nurbs curve representation of this polyline.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTransform
Applies a transform to all the points in the list.
(Inherited from Point3dList.)
Public methodTriangulateClosedPolyline
Attempts to create a list of triangles which represent a triangulation of a closed polyline
Public methodTrim
Constructs a polyline out of a parameter subdomain in this curve.
Public methodTrimExcess
Sets the capacity to the actual number of elements in the List, if that number is less than a threshold value.
(Inherited from RhinoListT.)
Public methodTrueForAll
Determines whether every element in the List matches the conditions defined by the specified predicate.
(Inherited from RhinoListT.)
Top
See Also