Class Polyline
Represents a polyline of 3-dimensional points.
Implements
Namespace: Paramdigma.Core.Geometry
Assembly: Paramdigma.Core.dll
Syntax
public class Polyline : BaseCurve, IEnumerable<Point3d>
Constructors
| Improve this Doc View SourcePolyline()
Initializes a new instance of the Polyline class.
Declaration
public Polyline()
Polyline(List<Point3d>)
Initializes a new instance of the Polyline class from a list of points.
Declaration
public Polyline(List<Point3d> knots)
Parameters
Type | Name | Description |
---|---|---|
List<Point3d> | knots | List of points. |
Properties
| Improve this Doc View SourceIsClosed
Gets a value indicating whether the polyline is closed (first point == last point).
Declaration
public bool IsClosed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsUnset
Gets a value indicating whether the polyline is unset.
Declaration
public bool IsUnset { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Int32]
Gets the knot at the specified index.
Declaration
public Point3d this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
Property Value
Type | Description |
---|---|
Point3d |
Knots
Gets the list of knots for this polyline.
Declaration
public List<Point3d> Knots { get; }
Property Value
Type | Description |
---|---|
List<Point3d> |
Segments
Gets the segment lines of the polyline.
Declaration
public List<Line> Segments { get; }
Property Value
Type | Description |
---|---|
List<Line> | Line. |
Methods
| Improve this Doc View SourceAddKnot(Point3d)
Add a new knot vertex at the end of the polyline.
Declaration
public void AddKnot(Point3d knot)
Parameters
Type | Name | Description |
---|---|---|
Point3d | knot | Point to add. |
BinormalAt(Double)
Compute a binormal vector along the curve at a specified parameter.
Declaration
public override Vector3d BinormalAt(double t)
Parameters
Type | Name | Description |
---|---|---|
System.Double | t | Parameter. |
Returns
Type | Description |
---|---|
Vector3d | Binormal vector at the parameter specified. |
Overrides
| Improve this Doc View SourceCheckValidity()
Checks the validity of the polyline. Currently only checks if some segments are collapsed (length == 0).
Declaration
public override bool CheckValidity()
Returns
Type | Description |
---|---|
System.Boolean | True if polyline has no collapsed segments. |
Overrides
| Improve this Doc View SourceComputeLength()
Computes the length of the curve.
Declaration
protected override double ComputeLength()
Returns
Type | Description |
---|---|
System.Double | Length as number. |
Overrides
| Improve this Doc View SourceFrameAt(Double)
Compute the perpendicular frame along the curve at a specified parameter.
Declaration
public override Plane FrameAt(double t)
Parameters
Type | Name | Description |
---|---|---|
System.Double | t | Parameter. |
Returns
Type | Description |
---|---|
Plane | Perpendicular plane at the parameter specified. |
Overrides
| Improve this Doc View SourceGetEnumerator()
Declaration
public IEnumerator<Point3d> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<Point3d> |
InsertKnot(Point3d, Int32)
Add a new knot vertex at the specified index.
Declaration
public void InsertKnot(Point3d knot, int index)
Parameters
Type | Name | Description |
---|---|---|
Point3d | knot | Point to add. |
System.Int32 | index | Location to add at. |
NormalAt(Double)
Compute normal vector along the curve at a specified parameter.
Declaration
public override Vector3d NormalAt(double t)
Parameters
Type | Name | Description |
---|---|---|
System.Double | t | Parameter. |
Returns
Type | Description |
---|---|
Vector3d | Normal vector at the parameter specified. |
Overrides
| Improve this Doc View SourcePointAt(Double)
Compute a point along the curve at a specified parameter.
Declaration
public override Point3d PointAt(double t)
Parameters
Type | Name | Description |
---|---|---|
System.Double | t | Parameter. |
Returns
Type | Description |
---|---|
Point3d | Point at the parameter specified. |
Overrides
| Improve this Doc View SourceRemoveKnot(Point3d)
Delete a specific knot if it exists in the polyline. If the point exists multiple times, it will remove the first occurrence.
Declaration
public void RemoveKnot(Point3d knot)
Parameters
Type | Name | Description |
---|---|---|
Point3d | knot | Point to delete. |
RemoveKnotAt(Int32)
Delete a knot at a specific index.
Declaration
public void RemoveKnotAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index to delete knot at. |
TangentAt(Double)
Compute the tangent vector along the curve at a specified parameter.
Declaration
public override Vector3d TangentAt(double t)
Parameters
Type | Name | Description |
---|---|---|
System.Double | t | Parameter. |
Returns
Type | Description |
---|---|
Vector3d | Tangent vector at the parameter specified. |