Table of Contents

DisplaySegments2

from OpenCAD2D import DisplaySegments2

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

Separate straight segments drawn alike, each from its own start to its own end: the lines of a hatch's pattern cut by its loops, kept as one item so that a hatch of 11 000 dashes is one thing to pick and to draw.

Constructors

__init__

.NET

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

Makes a set of segments.

Properties and fields

Bounds

.NET

@property
def Bounds(self) -> DisplayBox

Gets the box that holds the item.

Count

.NET

@property
def Count(self) -> int

Gets the number of segments.

Rings

.NET

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

Gets the loops of the hatch the segments are the pattern of, X and Y in turn, as the display list placed them: the canvas fills them with a tint where the lines come closer than 2 pixels, as a hatch of ANSI31 at spacing 3 does on a sheet of 80 metres shown whole. Empty where the segments have no loops.

Xy

.NET

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

Gets the segments, four numbers each: the start's X and Y, then the end's.

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.