MinMax2D
Canonical path: NemAll_Python_Geometry.MinMax2D
Representation class for 2D MinMax box.
Methods:
-
Deflate–Overloaded function. See individual overloads.
-
Get–Get minimum and maximum point
-
GetCenter–Get box center point
-
GetMax–Get maximum point
-
GetMin–Get minimum point
-
GetSizeX–Get the size of the box in the X direction
-
GetSizeY–Get the size of the box in the Y direction
-
Inflate–Overloaded function. See individual overloads.
-
IsContaining–Overloaded function. See individual overloads.
-
IsValid–Test if box is valid
-
Overlaps–Does box overlap this box
-
Reset–Set min point to [DBL_MAX,DBL_MAX]
-
Set–Set minimum and maximum point
-
SetMax–Set maximum point
-
SetMin–Set minimum point
-
ToPolygon2D–Creates a 2D polygon from the minmax box the corners of MinMax.
-
__add__–Expand MinMax2D box.
-
__eq__–Comparison of min max values.
-
__getitem__–Get the corners of MinMax.
-
__iadd__–Overloaded function. See individual overloads.
-
__init__–Overloaded function. See individual overloads.
-
__repr__–Convert to string
Attributes:
-
Center(Point2D) –Get box center point
-
Max(Point2D) –Get maximum point
-
Min(Point2D) –Get minimum point
-
SizeX(float) –Get the size of the box in the X direction
-
SizeY(float) –Get the size of the box in the Y direction
Deflate
overloaded
Deflate minmax box
Parameters:
-
x(float) –Deflate in X axis
-
y(float) –Deflate in Y axis
Deflate in x,y axis concurrently
Parameters:
-
size(float) –Deflate in x and y axis concurrently
Get
GetSizeX
Get the size of the box in the X direction
Returns:
-
float–delta X value
GetSizeY
Get the size of the box in the Y direction
Returns:
-
float–delta Y value
Inflate
overloaded
Inflate minmax box
Parameters:
-
x(float) –Inflate in X axis
-
y(float) –Inflate in Y axis
Inflate in x,y axis concurrently
Parameters:
-
size(float) –Inflate in x and 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
Overlaps
Overlaps(box: MinMax2D) -> bool
Does box overlap this box
Parameters:
-
box(MinMax2D) –Box
Returns:
-
bool–true, if boxes overlap, otherwise false
Set
ToPolygon2D
__add__
__eq__
__eq__(min_max: MinMax2D) -> bool
Comparison of min max values.
Be careful, this method work without tolerance!
Parameters:
-
min_max(MinMax2D) –min max to be compared.
Returns:
-
bool–True when min max values are equal, otherwise false.
__getitem__
__getitem__(index: int) -> Point2D
Get the corners of MinMax.
This method is checked and throwing Geometry::Exception when index is out of range.
Parameters:
-
index(int) –Corner index (0-left bottom, 1-right bottom, 2-right top, 3-left top)
Returns:
-
Point2D–corner as Point2D in world coordinate system.
__iadd__
overloaded
__iadd__(box: BoundingBox2D) -> MinMax2D
Expand MinMax2D box.
Expands the MinMax2D box by the bounding box given in parameter box
Parameters:
-
box(BoundingBox2D) –Bounding box to be added
Returns:
-
MinMax2D–minmax box.