Skip to content

MinMax2D

Canonical path: NemAll_Python_Geometry.MinMax2D

Representation class for 2D MinMax box.

Max property writable

Max: Point2D

Get maximum point

Min property writable

Min: Point2D

Get minimum point

SizeX property

SizeX: float

Get the size of the box in the X direction

SizeY property

SizeY: float

Get the size of the box in the Y direction

Deflate overloaded

Deflate(x: float, y: float)

Deflate in x and y axis.

Deflate(size: float)

Deflate in x,y axis concurrently.

Get

Get() -> tuple[Point2D, Point2D]

Get minimum and maximum point

Returns:

GetCenter

GetCenter() -> Point2D

Get box center point

Returns:

GetMax

GetMax() -> Point2D

Get maximum point

Returns:

GetMin

GetMin() -> Point2D

Get minimum point

Returns:

GetSizeX

GetSizeX() -> float

Get the size of the box in the X direction

Returns:

  • float

    delta X value

GetSizeY

GetSizeY() -> float

Get the size of the box in the Y direction

Returns:

  • float

    delta Y value

Inflate overloaded

Inflate(x: float, y: float)

ame Inflate and deflate minmax box

Inflate in x and y axis.

Inflate(size: float)

Inflate in x,y axis concurrently.

IsContaining overloaded

IsContaining(box: MinMax2D) -> bool

Is box inside this box

Parameters:

  • box (MinMax2D) –

    Potentially contained box

Returns:

  • bool

    true, if is inside, otherwise false

IsContaining(point: Point2D) -> bool

Is point inside this box

Parameters:

  • point (Point2D) –

    point in world coordinate system

Returns:

  • bool

    true, if is inside, otherwise false

IsValid

IsValid() -> bool

Test if box is valid

Returns:

  • bool

    true, if box valid, otherwise false

Overlaps

Overlaps(box: MinMax2D) -> bool

Does box overlap this box

Parameters:

Returns:

  • bool

    true, if boxes overlap, otherwise false

Reset

Reset()

Set min point to [DBL_MAX,DBL_MAX] and max point to [-DBL_MAX,-DBL_MAX]

Set

Set(min: Point2D, max: Point2D)

Set minimum and maximum point

Parameters:

SetMax

SetMax(max: Point2D)

Set maximum point

Parameters:

SetMin

SetMin(min: Point2D)

Set minimum point

Parameters:

ToPolygon2D

ToPolygon2D() -> tuple[bool, Polygon2D]

Creates a 2D polygon from the minmax box the corners of MinMax.

Returns:

  • tuple[bool, Polygon2D]

    tuple(true, if the polygon has been created successfully, otherwise false, polygon created from the minmax box)

__add__

__add__(minmax: MinMax2D) -> MinMax2D

Expand MinMax2D box.

Expands the MinMax2D box by the box given in parameter minmax

Parameters:

  • minmax (MinMax2D) –

    MinMax2D to be added

Returns:

__eq__

__eq__(minmax: MinMax2D) -> object

Comparison of minmax objects without tolerance.

Be careful, this method work without tolerance!

Parameters:

  • minmax (MinMax2D) –

    Compared minmax.

Returns:

  • object

    True when minmax objects are equal, otherwise false.

__getitem__

__getitem__(index: int) -> Point2D

Get the corners of MinMax. Corner index (0-left bottom, 1-right bottom, 2-right top, 3-left top)

This method is checked and throwing Geometry::Exception when index is out of range.

Returns:

  • Point2D

    corner as Point2D in world coordinate system.

__iadd__ overloaded

__iadd__(minmax: MinMax2D) -> MinMax2D

Expand MinMax2D box.

Expands the MinMax2D box by the box given in parameter minmax

Parameters:

  • minmax (MinMax2D) –

    MinMax2D to be added

Returns:

__iadd__(point: Point2D) -> MinMax2D

Expand MinMax2D box.

Expands the MinMax2D box by the Point2D given in parameter point

Parameters:

  • point (Point2D) –

    Point2D to be added

Returns:

__iadd__(box: BoundingBox2D) -> MinMax2D

Expand MinMax2D box.

Expands the MinMax2D box by the bounding box given in parameter box

Parameters:

Returns:

__init__ overloaded

__init__()

Initialize

__init__(min: Point2D, max: Point2D)

Set constructor

Initialize MinMax box with given MIN and MAX points.

Parameters:

__init__(point: Point2D)

Set constructor

Initialize MinMax box with given point.

Parameters:

__init__(minmax: MinMax2D)

Copy constructor.

Parameters:

  • minmax (MinMax2D) –

    MinMax2D to be copied

__init__(minmax: MinMax3D)

Copy constructor.

Parameters:

  • minmax (MinMax3D) –

    the MinMax3D box to be copied into MinMax2D. Only X and Y values will be copied

__repr__

__repr__() -> str

Convert to string

Placeholder