Table of Contents

DisplayPolyline2

from OpenCAD2D import DisplayPolyline2

class DisplayPolyline2(DisplayItem2) ยท DisplayPolyline2 in the .NET reference

A chain of straight segments, open or closed: a LINE, a polyline, a flattened spline or ellipse.

Constructors

__init__

.NET

def __init__(
    self,
    xy: Sequence[float] | System.Array[float],
    closed: bool,
    style: DisplayStyle,
    handle: str,
    layer: str,
) -> None

Makes a chain.

Properties and fields

Bounds

.NET

@property
def Bounds(self) -> DisplayBox

Gets the box that holds the item.

Closed

.NET

@property
def Closed(self) -> bool

Gets whether the last vertex joins the first.

Count

.NET

@property
def Count(self) -> int

Gets the number of vertices.

IsSampled

.NET

@property
def IsSampled(self) -> bool

Gets whether the vertices are samples along a curve (an ellipse, a spline, an arc drawn under a skew) rather than corners of the entity, so that object snaps take only the chain's two ends as endpoints and none of its midpoints.

Xy

.NET

@property
def Xy(self) -> System.Collections.Generic.IReadOnlyList[float]

Gets the vertices as X and Y in turn. A chain of two keeps no list of them, so each ask makes one: ask once and read it.

Methods

DistanceTo

.NET

def DistanceTo(self, x: float, y: float) -> float

Gets the distance from a point to the item, the shortest to any part that is drawn; the distance to the nearest edge for a fill, nought inside it.

Touches

.NET

def Touches(self, box: DisplayBox) -> bool

Gets whether any part of the item touches a box, as a crossing selection asks.