Class LwPolyline
Represents a light weight polyline EntityObject.
Inherited Members
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class LwPolyline : EntityObject, IHasXData, ICloneable
Remarks
Light weight polylines are bidimensional polylines that can hold information about the width of the lines and arcs that compose them.
Constructors
| Improve this Doc View SourceLwPolyline()
Initializes a new instance of the LwPolyline class.
Declaration
public LwPolyline()
LwPolyline(IEnumerable<LwPolylineVertex>)
Initializes a new instance of the LwPolyline class.
Declaration
public LwPolyline(IEnumerable<LwPolylineVertex> vertexes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<LwPolylineVertex> | vertexes | LwPolyline LwPolylineVertex list in object coordinates. |
LwPolyline(IEnumerable<LwPolylineVertex>, Boolean)
Initializes a new instance of the LwPolyline class.
Declaration
public LwPolyline(IEnumerable<LwPolylineVertex> vertexes, bool isClosed)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<LwPolylineVertex> | vertexes | LwPolyline LwPolylineVertex list in object coordinates. |
| System.Boolean | isClosed | Sets if the polyline is closed (default: false). |
LwPolyline(IEnumerable<Vector2>)
Initializes a new instance of the LwPolyline class.
Declaration
public LwPolyline(IEnumerable<Vector2> vertexes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Vector2> | vertexes | LwPolyline Vector2 list in object coordinates. |
LwPolyline(IEnumerable<Vector2>, Boolean)
Initializes a new instance of the LwPolyline class.
Declaration
public LwPolyline(IEnumerable<Vector2> vertexes, bool isClosed)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Vector2> | vertexes | LwPolyline Vector2 list in object coordinates. |
| System.Boolean | isClosed | Sets if the polyline is closed, by default it will create an open polyline. |
Properties
| Improve this Doc View SourceElevation
Gets or sets the light weight polyline elevation.
Declaration
public double Elevation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
This is the distance from the origin to the plane of the light weight polyline.
IsClosed
Gets or sets if the light weight polyline is closed.
Declaration
public bool IsClosed { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LinetypeGeneration
Enable or disable if the line type pattern is generated continuously around the vertexes of the polyline.
Declaration
public bool LinetypeGeneration { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Thickness
Gets or sets the light weight polyline thickness.
Declaration
public double Thickness { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Vertexes
Gets or sets the light weight polyline LwPolylineVertex list.
Declaration
public List<LwPolylineVertex> Vertexes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<LwPolylineVertex> |
Methods
| Improve this Doc View SourceClone()
Creates a new LwPolyline that is a copy of the current instance.
Declaration
public override object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new LwPolyline that is a copy of this instance. |
Overrides
| Improve this Doc View SourceExplode()
Declaration
public List<EntityObject> Explode()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<EntityObject> |
PolygonalVertexes(Int32, Double, Double)
Obtains a list of vertexes that represent the polyline approximating the curve segments as necessary.
Declaration
public List<Vector2> PolygonalVertexes(int bulgePrecision, double weldThreshold, double bulgeThreshold)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | bulgePrecision | Curve segments precision (a value of zero means that no approximation will be made). |
| System.Double | weldThreshold | Tolerance to consider if two new generated vertexes are equal. |
| System.Double | bulgeThreshold | Minimum distance from which approximate curved segments of the polyline. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Vector2> | A list of vertexes expressed in object coordinate system. |
Reverse()
Switch the polyline direction.
Declaration
public void Reverse()
SetConstantWidth(Double)
Sets a constant width for all the polyline segments.
Declaration
public void SetConstantWidth(double width)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | width | Polyline width. |
TransformBy(Matrix3, Vector3)
Moves, scales, and/or rotates the current entity given a 3x3 transformation matrix and a translation vector.
Declaration
public override void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
| Type | Name | Description |
|---|---|---|
| Matrix3 | transformation | Transformation matrix. |
| Vector3 | translation | Translation vector. |
Overrides
Remarks
Non-uniform scaling is not supported if a bulge different than zero is applied to any of the LwPolyline vertexes,
a non-uniform scaling cannot be applied to the arc segments. Explode the entity and convert the arcs into ellipse arcs and transform them instead.
Matrix3 adopts the convention of using column vectors to represent a transformation matrix.