The class describes the Oriented Bounding Box (OBB), much tighter enclosing volume for the shape than the Axis Aligned Bounding Box (AABB). The OBB is defined by a center of the box, the axes and the halves of its three dimensions. The OBB can be used more effectively than AABB as a rejection mechanism for non-interfering objects.
More...
|
| | Bnd_OBB () |
| | Empty constructor.
|
| |
| | Bnd_OBB (const gp_Pnt &theCenter, const gp_Dir &theXDirection, const gp_Dir &theYDirection, const gp_Dir &theZDirection, const double theHXSize, const double theHYSize, const double theHZSize) |
| | Constructor taking all defining parameters.
|
| |
| | Bnd_OBB (const Bnd_Box &theBox) |
| | Constructor to create OBB from AABB.
|
| |
| void | ReBuild (const NCollection_Array1< gp_Pnt > &theListOfPoints, const NCollection_Array1< double > *theListOfTolerances=nullptr, const bool theIsOptimal=false) |
| | Creates new OBB covering every point in theListOfPoints. Tolerance of every such point is set by *theListOfTolerances array. If this array is not void (not null-pointer) then the resulted Bnd_OBB will be enlarged using tolerances of points lying on the box surface. <theIsOptimal> flag defines the mode in which the OBB will be built. Constructing Optimal box takes more time, but the resulting box is usually more tight. In case of construction of Optimal OBB more possible axes are checked.
|
| |
| void | SetCenter (const gp_Pnt &theCenter) |
| | Sets the center of OBB.
|
| |
| void | SetXComponent (const gp_Dir &theXDirection, const double theHXSize) |
| | Sets the X component of OBB - direction and size.
|
| |
| void | SetYComponent (const gp_Dir &theYDirection, const double theHYSize) |
| | Sets the Y component of OBB - direction and size.
|
| |
| void | SetZComponent (const gp_Dir &theZDirection, const double theHZSize) |
| | Sets the Z component of OBB - direction and size.
|
| |
| gp_Ax3 | Position () const |
| | Returns the local coordinates system of this oriented box. So that applying it to axis-aligned box ((-XHSize, -YHSize, -ZHSize), (XHSize, YHSize, ZHSize)) will produce this oriented box.
|
| |
| const gp_XYZ & | Center () const noexcept |
| | Returns the center of OBB.
|
| |
| const gp_XYZ & | XDirection () const noexcept |
| | Returns the X Direction of OBB.
|
| |
| const gp_XYZ & | YDirection () const noexcept |
| | Returns the Y Direction of OBB.
|
| |
| const gp_XYZ & | ZDirection () const noexcept |
| | Returns the Z Direction of OBB.
|
| |
| double | XHSize () const noexcept |
| | Returns the X Dimension of OBB.
|
| |
| double | YHSize () const noexcept |
| | Returns the Y Dimension of OBB.
|
| |
| double | ZHSize () const noexcept |
| | Returns the Z Dimension of OBB.
|
| |
| HalfSizes | GetHalfSizes () const noexcept |
| | Returns the half-size dimensions of the OBB as a HalfSizes structure. Can be used with C++17 structured bindings:
|
| |
| bool | IsVoid () const noexcept |
| | Checks if the box is empty.
|
| |
| void | SetVoid () |
| | Clears this box.
|
| |
| void | SetAABox (const bool &theFlag) |
| | Sets the flag for axes aligned box.
|
| |
| bool | IsAABox () const noexcept |
| | Returns TRUE if the box is axes aligned.
|
| |
| void | Enlarge (const double theGapAdd) |
| | Enlarges the box with the given value.
|
| |
| bool | GetVertex (gp_Pnt theP[8]) const |
| | Returns the array of vertices in <this>. The local coordinate of the vertex depending on the index of the array are follow: Index == 0: (-XHSize(), -YHSize(), -ZHSize()) Index == 1: ( XHSize(), -YHSize(), -ZHSize()) Index == 2: (-XHSize(), YHSize(), -ZHSize()) Index == 3: ( XHSize(), YHSize(), -ZHSize()) Index == 4: (-XHSize(), -YHSize(), ZHSize()) Index == 5: ( XHSize(), -YHSize(), ZHSize()) Index == 6: (-XHSize(), YHSize(), ZHSize()) Index == 7: ( XHSize(), YHSize(), ZHSize()).
|
| |
| double | SquareExtent () const noexcept |
| | Returns square diagonal of this box.
|
| |
| bool | IsOut (const Bnd_OBB &theOther) const |
| | Check if the box do not interfere the other box.
|
| |
| bool | IsOut (const gp_Pnt &theP) const |
| | Check if the point is inside of <this>.
|
| |
| bool | Contains (const gp_Pnt &theP) const |
| | Returns True if the point is inside or on the boundary of this OBB.
|
| |
| bool | Intersects (const Bnd_OBB &theOther) const |
| | Returns True if the other OBB intersects or is inside this OBB.
|
| |
| bool | IsCompletelyInside (const Bnd_OBB &theOther) const |
| | Check if the theOther is completely inside *this.
|
| |
| void | Add (const Bnd_OBB &theOther) |
| | Rebuilds this in order to include all previous objects (which it was created from) and theOther.
|
| |
| void | Add (const gp_Pnt &theP) |
| | Rebuilds this in order to include all previous objects (which it was created from) and theP.
|
| |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const |
| | Dumps the content of me into the stream.
|
| |
The class describes the Oriented Bounding Box (OBB), much tighter enclosing volume for the shape than the Axis Aligned Bounding Box (AABB). The OBB is defined by a center of the box, the axes and the halves of its three dimensions. The OBB can be used more effectively than AABB as a rejection mechanism for non-interfering objects.