Table of Contents

DisplayBox

from OpenCAD2D import DisplayBox

class DisplayBox(System.ValueType) ยท DisplayBox in the .NET reference

An axis-aligned box in drawing coordinates, as the extents of a display item or of a whole space.

Constructors

__init__

.NET

def __init__(self, minX: float, minY: float, maxX: float, maxY: float) -> None

Makes a box from its corners.

Properties and fields

Empty

.NET

Empty: ClassVar[DisplayBox]

Gets the box that holds nothing: its minimum is above its maximum, so the first point added makes it that point.

Height

.NET

@property
def Height(self) -> float

Gets the height, nought for an empty box.

IsEmpty

.NET

@property
def IsEmpty(self) -> bool

Gets whether the box holds nothing.

MaxX

.NET

@property
def MaxX(self) -> float

Gets the greatest X.

MaxY

.NET

@property
def MaxY(self) -> float

Gets the greatest Y.

MinX

.NET

@property
def MinX(self) -> float

Gets the least X.

MinY

.NET

@property
def MinY(self) -> float

Gets the least Y.

Width

.NET

@property
def Width(self) -> float

Gets the width, nought for an empty box.

Methods

Add

.NET

def Add(self, x: float, y: float) -> DisplayBox

Gets the box grown to hold a point.

Contains

.NET

def Contains(self, other: DisplayBox) -> bool

Gets whether this box holds another wholly.

def Contains(self, x: float, y: float) -> bool

Gets whether this box holds a point.

Inflate

.NET

def Inflate(self, margin: float) -> DisplayBox

Gets the box grown by a margin on every side.

Intersects

.NET

def Intersects(self, other: DisplayBox) -> bool

Gets whether this box and another share a point.

Union

.NET

def Union(self, other: DisplayBox) -> DisplayBox

Gets the box grown to hold another box.