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__
def __init__(self, minX: float, minY: float, maxX: float, maxY: float) -> None
Makes a box from its corners.
Properties and fields
Empty
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
@property
def Height(self) -> float
Gets the height, nought for an empty box.
IsEmpty
@property
def IsEmpty(self) -> bool
Gets whether the box holds nothing.
MaxX
@property
def MaxX(self) -> float
Gets the greatest X.
MaxY
@property
def MaxY(self) -> float
Gets the greatest Y.
MinX
@property
def MinX(self) -> float
Gets the least X.
MinY
@property
def MinY(self) -> float
Gets the least Y.
Width
@property
def Width(self) -> float
Gets the width, nought for an empty box.
Methods
Add
def Add(self, x: float, y: float) -> DisplayBox
Gets the box grown to hold a point.
Contains
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
def Inflate(self, margin: float) -> DisplayBox
Gets the box grown by a margin on every side.
Intersects
def Intersects(self, other: DisplayBox) -> bool
Gets whether this box and another share a point.
Union
def Union(self, other: DisplayBox) -> DisplayBox
Gets the box grown to hold another box.