Generated by DocFX

Class PolyLine

A simple data structure representing a polyline.

Inheritance
System.Object
NurbsBase
PolyLine
Polygon
Inherited Members
NurbsBase.Weights
NurbsBase.Degree
NurbsBase.ControlPointLocations
NurbsBase.ControlPoints
NurbsBase.Knots
NurbsBase.IsPeriodic
NurbsBase.ParameterAtChordLength(Double, Double)
NurbsBase.DivideByChordLength(Double)
NurbsBase.TangentAt(Double)
NurbsBase.DerivativeAt(Double, Int32)
NurbsBase.Extrema()
NurbsBase.CurvatureAt(Double)
NurbsBase.PerpendicularFrameAt(Double)
NurbsBase.ClampEnds()
NurbsBase.Join(IList<NurbsBase>)
NurbsBase.DecomposeIntoBeziers()
NurbsBase.ElevateDegree(Int32)
NurbsBase.ReduceDegree(Double)
NurbsBase.Divide(Int32)
NurbsBase.Divide(Double, Boolean)
NurbsBase.PerpendicularFrames(List<Double>, Nullable<Vector3>, Nullable<Vector3>)
NurbsBase.SplitAt(Double)
NurbsBase.SplitAt(Double[])
NurbsBase.SubCurve(Interval)
NurbsBase.Equals(NurbsBase)
NurbsBase.Equals(Object)
NurbsBase.GetHashCode()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public class PolyLine : NurbsBase, IGeometry<NurbsBase>, IEquatable<NurbsBase>, ITransformable<NurbsBase>, IGeometry<PolyLine>, IEquatable<PolyLine>, ITransformable<PolyLine>
Examples
ExamplePts = new[]
{
    new Point3(5, 0, 0),
    new Point3(15, 15, 0),
    new Point3(20, 5, 0),
    new Point3(30, 10, 0),
    new Point3(45, 12.5, 0)
};

_polyLine = new PolyLine(ExamplePts);

Constructors

| Improve this Doc View Source

PolyLine(IList<Point3>)

Initializes a new polyline from a collection of points.

Declaration
public PolyLine(IList<Point3> vertices)
Parameters
Type Name Description
System.Collections.Generic.IList<Point3> vertices

Points used to create the polyline.

Properties

| Improve this Doc View Source

EndPoint

Gets the end point of the polyline.

Declaration
public override Point3 EndPoint { get; }
Property Value
Type Description
Point3
Overrides
NurbsBase.EndPoint
| Improve this Doc View Source

IsClosed

Gets true if the polyline is closed. A polyline is considered closed, if its start and end point are identical.

Declaration
public override bool IsClosed { get; }
Property Value
Type Description
System.Boolean
Overrides
NurbsBase.IsClosed
| Improve this Doc View Source

Length

Calculates the length of the polyline.

Declaration
public override double Length { get; }
Property Value
Type Description
System.Double

The total length of the polyline.

Overrides
NurbsBase.Length
| Improve this Doc View Source

MidPoint

Gets the middle point of the polyline.

Declaration
public override Point3 MidPoint { get; }
Property Value
Type Description
Point3
Overrides
NurbsBase.MidPoint
| Improve this Doc View Source

Segments

Constructs a collections of lines, which make the polyline.

Declaration
public List<Line> Segments { get; }
Property Value
Type Description
System.Collections.Generic.List<Line>

A collection of lines.

| Improve this Doc View Source

SegmentsCount

Gets the number of segments for this polyline;

Declaration
public int SegmentsCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

StartPoint

Gets the starting point of the polyline.

Declaration
public override Point3 StartPoint { get; }
Property Value
Type Description
Point3
Overrides
NurbsBase.StartPoint

Methods

| Improve this Doc View Source

Close()

Creates a closed polyline, where the first and last point are the same.

Declaration
public PolyLine Close()
Returns
Type Description
PolyLine

A closed polyline.

| Improve this Doc View Source

ClosestParameter(Point3)

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

Declaration
public override double ClosestParameter(Point3 pt)
Parameters
Type Name Description
Point3 pt

The point to test.

Returns
Type Description
System.Double

The parameter closest to the test point.

Overrides
NurbsBase.ClosestParameter(Point3)
| Improve this Doc View Source

ClosestPoint(Point3)

Computes the point which is the closest point to the given point.

Declaration
public override Point3 ClosestPoint(Point3 pt)
Parameters
Type Name Description
Point3 pt

Point to test.

Returns
Type Description
Point3

The point closest to the given point.

Overrides
NurbsBase.ClosestPoint(Point3)
| Improve this Doc View Source

Equals(PolyLine)

Checks if a polyline is equal to the provided polyline.
Two polyline are equal if all the points are the same.

Declaration
public bool Equals(PolyLine other)
Parameters
Type Name Description
PolyLine other

The polyline to compare.

Returns
Type Description
System.Boolean

True if the points are equal, otherwise false.

| Improve this Doc View Source

GetBoundingBox()

Computes the bounding box of the list of points.

Declaration
public override BoundingBox GetBoundingBox()
Returns
Type Description
BoundingBox

The bounding box.

Overrides
NurbsBase.GetBoundingBox()
| Improve this Doc View Source

LengthAt(Double)

Evaluated the length on the polyline at the given parameter.

Declaration
public override double LengthAt(double t)
Parameters
Type Name Description
System.Double t

Evaluate parameter. Parameter should be between 0.0 and segments count.

Returns
Type Description
System.Double

The evaluated length at the curve parameter.

Overrides
NurbsBase.LengthAt(Double)
| Improve this Doc View Source

Offset(Double, Plane)

Computes the offset of the polyline.

Declaration
public PolyLine Offset(double distance, Plane pln)
Parameters
Type Name Description
System.Double distance

The distance of the offset. If negative the offset will be in the opposite side.

Plane pln

The plane for the offset operation.

Returns
Type Description
PolyLine

The offset polyline.

| Improve this Doc View Source

ParameterAtLength(Double)

Calculates the parameter of the polyline at the given length.

Declaration
public override double ParameterAtLength(double length)
Parameters
Type Name Description
System.Double length

Length from start of polyline.

Returns
Type Description
System.Double

The parameter at the given length.

Overrides
NurbsBase.ParameterAtLength(Double)
| Improve this Doc View Source

PointAt(Double)

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

Declaration
public override Point3 PointAt(double t)
Parameters
Type Name Description
System.Double t

Evaluate parameter. Parameter should be between 0.0 and segments count.

Returns
Type Description
Point3

The evaluated point at the curve parameter.

Overrides
NurbsBase.PointAt(Double)
| Improve this Doc View Source

PointAtLength(Double)

Declaration
public override Point3 PointAtLength(double length)
Parameters
Type Name Description
System.Double length
Returns
Type Description
Point3
Overrides
NurbsBase.PointAtLength(Double)
| Improve this Doc View Source

PointAtNormalizedLength(Double)

Evaluates a point at the normalized length.

Declaration
public override Point3 PointAtNormalizedLength(double normalizedLength)
Parameters
Type Name Description
System.Double normalizedLength

The length factor is normalized between 0.0 and 1.0.

Returns
Type Description
Point3

The point at the length.

Overrides
NurbsBase.PointAtNormalizedLength(Double)
| Improve this Doc View Source

Reverse()

Reverses the order of the polyline.

Declaration
public PolyLine Reverse()
Returns
Type Description
PolyLine

A polyline reversed.

| Improve this Doc View Source

SegmentAtLength(Double)

Returns the index of the segment at a given length along the polyline.

Declaration
public Line SegmentAtLength(double length)
Parameters
Type Name Description
System.Double length

Length from start of polyline.

Returns
Type Description
Line

Zero based index of polyline segment.

| Improve this Doc View Source

ToString()

Constructs the string representation of the polyline.

Declaration
public override string ToString()
Returns
Type Description
System.String

A text string.

Overrides
NurbsBase.ToString()
| Improve this Doc View Source

Transform(TransformMatrix)

Applies a transformation to all the points.

Declaration
public PolyLine Transform(TransformMatrix transform)
Parameters
Type Name Description
TransformMatrix transform

Transformation matrix to apply.

Returns
Type Description
PolyLine

A polyline transformed.

Implements

IGeometry<T>
System.IEquatable<T>
ITransformable<T>
IGeometry<T>
System.IEquatable<T>
ITransformable<T>