Show / Hide Table of Contents

Class LwPolyline

Represents a light weight polyline EntityObject.

Inheritance
System.Object
DxfObject
EntityObject
LwPolyline
Implements
IHasXData
System.ICloneable
Inherited Members
EntityObject.LayerChanged
EntityObject.OnLayerChangedEvent(Layer, Layer)
EntityObject.LinetypeChanged
EntityObject.OnLinetypeChangedEvent(Linetype, Linetype)
EntityObject.XDataAddAppReg
EntityObject.OnXDataAddAppRegEvent(ApplicationRegistry)
EntityObject.XDataRemoveAppReg
EntityObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
EntityObject.Reactors
EntityObject.Type
EntityObject.Color
EntityObject.Layer
EntityObject.Linetype
EntityObject.Lineweight
EntityObject.Transparency
EntityObject.LinetypeScale
EntityObject.IsVisible
EntityObject.Normal
EntityObject.Owner
EntityObject.XData
EntityObject.TransformBy(Matrix4)
EntityObject.ToString()
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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 Source

LwPolyline()

Initializes a new instance of the LwPolyline class.

Declaration
public LwPolyline()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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).

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

Elevation

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.

| Improve this Doc View Source

IsClosed

Gets or sets if the light weight polyline is closed.

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

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
| Improve this Doc View Source

Thickness

Gets or sets the light weight polyline thickness.

Declaration
public double Thickness { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

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 Source

Clone()

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
EntityObject.Clone()
| Improve this Doc View Source

Explode()

Decompose the actual polyline in its internal entities, Line and Arc.

Declaration
public List<EntityObject> Explode()
Returns
Type Description
System.Collections.Generic.List<EntityObject>

A list of Line and Arc that made up the polyline.

| Improve this Doc View Source

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.

| Improve this Doc View Source

Reverse()

Switch the polyline direction.

Declaration
public void Reverse()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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
EntityObject.TransformBy(Matrix3, Vector3)
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.

Implements

IHasXData
System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX