Class Polyline
Class defining a polyline curve in three-dimensional euclidean space.
Implements
Namespace: BRIDGES.Geometry.Euclidean3D
Assembly: BRIDGES.dll
Syntax
public class Polyline : IEquatable<Polyline>, IGeometricallyEquatable<Polyline>
Constructors
| Improve this Doc View SourcePolyline(Polyline)
Declaration
public Polyline(Polyline polyline)
Parameters
Type | Name | Description |
---|---|---|
Polyline | polyline | Polyline to copy. |
Polyline(IEnumerable<Point>, Boolean)
Initialises a new instance of the Polyline class by defining its vertices.
Declaration
public Polyline(IEnumerable<Point> vertices, bool isClosed = false)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Point> | vertices | Position of the vertices. |
Boolean | isClosed | Determines whether the new Polyline is closed or not. |
Properties
| Improve this Doc View SourceDomainEnd
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public double DomainEnd { get; }
Property Value
Type | Description |
---|---|
Double |
DomainStart
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public double DomainStart { get; }
Property Value
Type | Description |
---|---|
Double |
EndPoint
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public Point EndPoint { get; }
Property Value
Type | Description |
---|---|
Point |
IsClosed
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public bool IsClosed { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Item[Int32]
Gets the vertex of the Polyline at the given index.
Declaration
public Point this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the vertex to retrieve. |
Property Value
Type | Description |
---|---|
Point | The Point representing the position of the vertex. |
SegmentCount
Gets the number of segments of the current Polyline.
Declaration
public int SegmentCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
StartPoint
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public Point StartPoint { get; }
Property Value
Type | Description |
---|---|
Point |
VertexCount
Gets the number of vertices of the current Polyline.
Declaration
public int VertexCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceAddVertex(Point)
Adds a vertex at the end of the polyline.
Declaration
public void AddVertex(Point vertex)
Parameters
Type | Name | Description |
---|---|---|
Point | vertex | Position of the new vertex. |
AddVertices(List<Point>)
Adds a list of vertices at the end of the polyline.
Declaration
public void AddVertices(List<Point> vertices)
Parameters
Type | Name | Description |
---|---|---|
List<Point> | vertices | Position of the new vertices. |
ClosestPoint(Point, out Double)
Retrieves the closest point on a polyline to a given point, and the distance from the point to the polyline.
Declaration
public Point ClosestPoint(Point point, out double t)
Parameters
Type | Name | Description |
---|---|---|
Point | point | Point to find the closest point from. |
Double | t | Distance from the given point and the point on the polyline. |
Returns
Type | Description |
---|---|
Point | The closest point on the polyline. |
Equals(Polyline)
Declaration
public bool Equals(Polyline other)
Parameters
Type | Name | Description |
---|---|---|
Polyline | other | Polyline to compare with. |
Returns
Type | Description |
---|---|
Boolean | true if the two Polyline are equal, false otherwise. |
Remarks
Two Polyline are equal if they have the same topology and their corresponding vertices are equal.
Equals(Object)
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Flip()
Flips the current Polyline by reversing the list of vertices.
Declaration
public void Flip()
GeometricallyEquals(Polyline)
Evaluates whether the current object is geometrically equal to the given T
.
Declaration
public bool GeometricallyEquals(Polyline other)
Parameters
Type | Name | Description |
---|---|---|
Polyline | other |
Returns
Type | Description |
---|---|
Boolean | true if the two objects are geometrically equal, false otherwise. |
GetHashCode()
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
InsertVertex(Int32, Point)
Inserts a vertex in the polyline at the given index.
Declaration
public void InsertVertex(int index, Point vertex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Zero-based index at which the vertex should be inserted. |
Point | vertex | Position of the new vertex. |
Length()
Computes the length of the current Polyline.
Declaration
public double Length()
Returns
Type | Description |
---|---|
Double | The value corresponding to the Polyline's length. |
PointAt(Double, CurveParameterFormat)
Evaluates the current Polyline at the given parameter.
Declaration
public Point PointAt(double t, CurveParameterFormat format)
Parameters
Type | Name | Description |
---|---|---|
Double | t | Parameter to evaluate the curve. |
CurveParameterFormat | format | Format of the parameter.
|
Returns
Type | Description |
---|---|
Point |
ReplaceVertex(Int32, Point)
Replaces a vertex in the polyline at the given index.
Declaration
public void ReplaceVertex(int index, Point vertex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Zero-based index of the vertex to replace. |
Point | vertex | New position of the vertex. |
ReplaceVertices(IEnumerable<Point>)
Replaces all the vertices in the polyline.
Declaration
public void ReplaceVertices(IEnumerable<Point> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Point> | vertices | New position of the vertices. |
ToString()
Class defining a polyline curve in three-dimensional euclidean space.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |