Class BoundingBox
- Namespace
- OpenMEPSandbox.Geometry.Abstract
- Assembly
- OpenMEPSandbox.dll
public class BoundingBox
- Inheritance
-
BoundingBox
- Inherited Members
Methods
Area(BoundingBox)
Get area of bounding box
[NodeCategory("Query")]
public static double Area(BoundingBox boundingBox)
Parameters
boundingBox
BoundingBoxthe boundingBox
Returns
- double
the area value of boundingBox
Examples
ByBoundingBoxs(List<BoundingBox>)
Create a bounding box from a list of bounding boxes
[NodeCategory("Create")]
public static BoundingBox ByBoundingBoxs(List<BoundingBox> boundingBoxes)
Parameters
boundingBoxes
List<BoundingBox>the list of boundingBox
Returns
- BoundingBox
new boundingBox crete by collection boundingBox
Examples
BoundingBox.ByBoundingBoxs.dyn
ByPoints(List<Point>)
Create a bounding box from a list of points
[NodeCategory("Create")]
public static BoundingBox ByPoints(List<Point> points)
Parameters
points
List<Point>the list point to create new bounding box
Returns
- BoundingBox
new boundingBox from list point
Examples
Center(BoundingBox)
Get center point of bounding box
[NodeCategory("Query")]
public static Point Center(BoundingBox boundingBox)
Parameters
boundingBox
BoundingBoxthe boundingBox need get point center
Returns
- Point
center point of boundingBox
Examples
Corners(BoundingBox)
Get 8 points corners of bounding box
[NodeCategory("Query")]
public static List<Point> Corners(BoundingBox boundingBox)
Parameters
boundingBox
BoundingBox
Returns
- List<Point>
list point corner of the boundingBox
Examples
Divide(BoundingBox, double)
Divide the bounding box by value
public static List<BoundingBox> Divide(BoundingBox boundingBox, double value)
Parameters
boundingBox
BoundingBoxthe boundingBox
value
doublehow many part boundingBox will divide for each edge
Returns
- List<BoundingBox>
the collection boundingBoxs divide
Examples
DivideByWidthAndLength(BoundingBox, double, double)
Divides a bounding box into smaller bounding boxes by width and length.
public static List<BoundingBox> DivideByWidthAndLength(BoundingBox boundingBox, double width, double length)
Parameters
boundingBox
BoundingBoxThe original bounding box to be divided.
width
doubleThe number of divisions along the width.
length
doubleThe number of divisions along the length.
Returns
- List<BoundingBox>
A list of smaller bounding boxes resulting from the division.
Examples
BoundingBox.DivideByWidthAndLength.dyn
DivideByWidthLengthHeight(BoundingBox, double, double, double)
Divides a given bounding box into smaller bounding boxes based on specified width, length, and height divisions.
public static List<BoundingBox> DivideByWidthLengthHeight(BoundingBox boundingBox, double width, double length, double height)
Parameters
boundingBox
BoundingBoxThe original bounding box to be divided.
width
doubleThe number of divisions along the width.
length
doubleThe number of divisions along the length.
height
doubleThe number of divisions along the height.
Returns
- List<BoundingBox>
A list of smaller bounding boxes resulting from the division.
Examples
BoundingBox.DivideByWidthLengthHeight.dyn
IsSimilar(BoundingBox, BoundingBox, double)
Determines whether two bounding boxes are similar within a specified tolerance.
[NodeCategory("Query")]
public static bool IsSimilar(BoundingBox boundingBox1, BoundingBox boundingBox2, double tolerance = 0.001)
Parameters
boundingBox1
BoundingBoxThe first bounding box to compare.
boundingBox2
BoundingBoxThe second bounding box to compare.
tolerance
doubleThe acceptable tolerance for dimension differences (default is 0.001).
Returns
- bool
True if the bounding boxes are similar within the tolerance; otherwise, false.
Examples
Scale(BoundingBox, double)
Scale the bounding box by value
public static BoundingBox Scale(BoundingBox boundingBox, double value)
Parameters
boundingBox
BoundingBoxthe boundingBox need scale
value
doublescale value
Returns
- BoundingBox
boundingBox
Examples
Visualize(BoundingBox)
Visualize the bounding box by corner points
public static List<Line> Visualize(BoundingBox boundingBox)
Parameters
boundingBox
BoundingBoxthe boundingBox
Returns
- List<Line>
the list line corner of the boundingBox
Examples
Volume(BoundingBox)
Returns the volume of the bounding box.
[NodeCategory("Query")]
public static double Volume(BoundingBox boundingBox)
Parameters
boundingBox
BoundingBoxthe boundingBox
Returns
- double
volume of the boundingBox