OCC.Bnd module¶
Supports the Boundings Volumes. A Bounding Volumeis used to bound a shape to optimising algorithms.If a point is outside the Bounding Volume of ashape it is also outside the shape. The contraryis not necessarily true.Various classes are then implemented to describethe usual Bounding volumes. Not all classes areimplemented.in 3D :Box ImplementedBoundSortBox Implementedin 2D :Box2d ImplementedBoundSortBox2d Implemented-Level : Public.All methods of all classes will be public.
-
class
Bnd_Array1OfBox
(*args)¶ Bases:
object
Parameters: Return type: Return type: -
Assign
()¶ Parameters: Other (Bnd_Array1OfBox &) – Return type: Bnd_Array1OfBox
-
Set
()¶ Parameters: Other (Bnd_Array1OfBox &) – Return type: Bnd_Array1OfBox
-
thisown
¶ The membership flag
-
-
class
Bnd_Array1OfBox2d
(*args)¶ Bases:
object
Parameters: Return type: Return type: -
Assign
()¶ Parameters: Other (Bnd_Array1OfBox2d &) – Return type: Bnd_Array1OfBox2d
-
Set
()¶ Parameters: Other (Bnd_Array1OfBox2d &) – Return type: Bnd_Array1OfBox2d
-
thisown
¶ The membership flag
-
-
class
Bnd_Array1OfSphere
(*args)¶ Bases:
object
Parameters: Return type: Return type: -
Assign
()¶ Parameters: Other (Bnd_Array1OfSphere &) – Return type: Bnd_Array1OfSphere
-
ChangeValue
()¶ Parameters: Index (int) – Return type: Bnd_Sphere
-
Set
()¶ Parameters: Other (Bnd_Array1OfSphere &) – Return type: Bnd_Array1OfSphere
-
Value
()¶ Parameters: Index (int) – Return type: Bnd_Sphere
-
thisown
¶ The membership flag
-
-
class
Bnd_B2d
(*args)¶ Bases:
object
Return type: Parameters: Return type: -
Add
()¶ Parameters: - thePnt (gp_Pnt2d) –
- thePnt –
- theBox (Bnd_B2d &) –
Return type: Return type: Return type:
-
IsOut
()¶ Parameters: Return type: Return type: Return type: Return type: Return type: Return type:
-
thisown
¶ The membership flag
-
-
class
Bnd_B2f
(*args)¶ Bases:
object
Return type: Parameters: Return type: -
Add
()¶ Parameters: - thePnt (gp_Pnt2d) –
- thePnt –
- theBox (Bnd_B2f &) –
Return type: Return type: Return type:
-
IsOut
()¶ Parameters: Return type: Return type: Return type: Return type: Return type: Return type:
-
thisown
¶ The membership flag
-
-
class
Bnd_B3d
(*args)¶ Bases:
object
Return type: Parameters: Return type: -
Add
()¶ Parameters: - thePnt (gp_Pnt) –
- thePnt –
- theBox (Bnd_B3d &) –
Return type: Return type: Return type:
-
IsOut
()¶ Parameters: - thePnt (gp_XYZ) –
- theCenter (gp_XYZ) –
- theRadius (float) –
- isSphereHollow (bool) – default value is Standard_False
- theOtherBox (Bnd_B3d &) –
- theOtherBox –
- theTrsf (gp_Trsf) –
- theLine (gp_Ax1) –
- isRay (bool) – default value is Standard_False
- theOverthickness (float) – default value is 0.0
- thePlane (gp_Ax3) –
Return type: Return type: Return type: Return type: Return type: Return type:
-
thisown
¶ The membership flag
-
-
class
Bnd_B3f
(*args)¶ Bases:
object
Return type: Parameters: Return type: -
Add
()¶ Parameters: - thePnt (gp_Pnt) –
- thePnt –
- theBox (Bnd_B3f &) –
Return type: Return type: Return type:
-
IsOut
()¶ Parameters: - thePnt (gp_XYZ) –
- theCenter (gp_XYZ) –
- theRadius (float) –
- isSphereHollow (bool) – default value is Standard_False
- theOtherBox (Bnd_B3f &) –
- theOtherBox –
- theTrsf (gp_Trsf) –
- theLine (gp_Ax1) –
- isRay (bool) – default value is Standard_False
- theOverthickness (float) – default value is 0.0
- thePlane (gp_Ax3) –
Return type: Return type: Return type: Return type: Return type: Return type:
-
thisown
¶ The membership flag
-
-
class
Bnd_BoundSortBox
(*args)¶ Bases:
object
- Constructs an empty comparison algorithm for bounding boxes. The bounding boxes are then defined using the Initialize function.
Return type: None -
Add
()¶ - Adds the bounding box theBox at position boxIndex in the array of boxes to be sorted by this comparison algorithm. This function is used only in conjunction with the third syntax described in the synopsis of Initialize. //! Exceptions: //! - Standard_OutOfRange if boxIndex is not in the range [ 1,nbComponents ] where nbComponents is the maximum number of bounding boxes declared for this comparison algorithm at initialization. //! - Standard_MultiplyDefined if a box already exists at position boxIndex in the array of boxes to be sorted by this comparison algorithm.
Parameters: - theBox (Bnd_Box &) –
- boxIndex (int) –
Return type:
-
Compare
()¶ - Compares the bounding box theBox, with the set of bounding boxes to be sorted by this comparison algorithm, and returns the list of intersecting bounding boxes as a list of indexes on the array of bounding boxes used by this algorithm.
Parameters: theBox (Bnd_Box &) – Return type: TColStd_ListOfInteger - Compares the plane P with the set of bounding boxes to be sorted by this comparison algorithm, and returns the list of intersecting bounding boxes as a list of indexes on the array of bounding boxes used by this algorithm.
Parameters: P (gp_Pln) – Return type: TColStd_ListOfInteger
-
Initialize
()¶ - Initializes this comparison algorithm with - the set of bounding boxes SetOfBox.
Parameters: - CompleteBox (Bnd_Box &) –
- SetOfBox (Handle_Bnd_HArray1OfBox &) –
Return type: - Initializes this comparison algorithm with - the set of bounding boxes SetOfBox, where CompleteBox is given as the global bounding box of SetOfBox.
Parameters: SetOfBox (Handle_Bnd_HArray1OfBox &) – Return type: None - Initializes this comparison algorithm, giving it only - the maximum number nbComponents of the bounding boxes to be managed. Use the Add function to define the array of bounding boxes to be sorted by this algorithm.
Parameters: - CompleteBox (Bnd_Box &) –
- nbComponents (int) –
Return type:
-
thisown
¶ The membership flag
-
class
Bnd_BoundSortBox2d
(*args)¶ Bases:
object
- Constructs an empty comparison algorithm for 2D bounding boxes. The bounding boxes are then defined using the Initialize function.
Return type: None -
Add
()¶ - Adds the 2D bounding box theBox at position boxIndex in the array of boxes to be sorted by this comparison algorithm. This function is used only in conjunction with the third syntax described in the synopsis of Initialize. Exceptions - Standard_OutOfRange if boxIndex is not in the range [ 1,nbComponents ] where nbComponents is the maximum number of bounding boxes declared for this comparison algorithm at initialization. - Standard_MultiplyDefined if a box still exists at position boxIndex in the array of boxes to be sorted by this comparison algorithm.
Parameters: - theBox (Bnd_Box2d &) –
- boxIndex (int) –
Return type:
-
Compare
()¶ - Compares the 2D bounding box theBox with the set of bounding boxes to be sorted by this comparison algorithm, and returns the list of intersecting bounding boxes as a list of indexes on the array of bounding boxes used by this algorithm.
Parameters: theBox (Bnd_Box2d &) – Return type: TColStd_ListOfInteger
-
Initialize
()¶ - Initializes this comparison algorithm with - the set of 2D bounding boxes SetOfBox
Parameters: - CompleteBox (Bnd_Box2d &) –
- SetOfBox (Handle_Bnd_HArray1OfBox2d &) –
Return type: - Initializes this comparison algorithm with - the set of 2D bounding boxes SetOfBox, where CompleteBox is given as the global bounding box of SetOfBox.
Parameters: SetOfBox (Handle_Bnd_HArray1OfBox2d &) – Return type: None - Initializes this comparison algorithm, giving it only - the maximum number nbComponents, and - the global bounding box CompleteBox, of the 2D bounding boxes to be managed. Use the Add function to define the array of bounding boxes to be sorted by this algorithm.
Parameters: - CompleteBox (Bnd_Box2d &) –
- nbComponents (int) –
Return type:
-
thisown
¶ The membership flag
-
class
Bnd_Box
(*args)¶ Bases:
object
- Creates an empty Box. The constructed box is qualified Void. Its gap is null.
Return type: None -
Add
()¶ - Adds the box <Other> to <self>.
Parameters: Other (Bnd_Box &) – Return type: None - Adds a Pnt to the box.
Parameters: P (gp_Pnt) – Return type: None - Extends <self> from the Pnt <P> in the direction <D>.
Parameters: Return type: - Extends the Box in the given Direction, i.e. adds an half-line. The box may become infinite in 1,2 or 3 directions.
Parameters: D (gp_Dir) – Return type: None
-
CornerMax
()¶ - Returns the upper corner of this bounding box. The gap is included. If this bounding box is infinite (i.e. ‘open’), returned values may be equal to +/- Precision::Infinite(). Standard_ConstructionError exception will be thrown if the box is void. if IsVoid()
Return type: gp_Pnt
-
CornerMin
()¶ - Returns the lower corner of this bounding box. The gap is included. If this bounding box is infinite (i.e. ‘open’), returned values may be equal to +/- Precision::Infinite(). Standard_ConstructionError exception will be thrown if the box is void. if IsVoid()
Return type: gp_Pnt
-
Distance
()¶ - Computes the minimum distance between two boxes.
Parameters: Other (Bnd_Box &) – Return type: float
-
Enlarge
()¶ - Enlarges the box with a tolerance value. (minvalues-Abs(<tol>) and maxvalues+Abs(<tol>)) This means that the minimum values of its X, Y and Z intervals of definition, when they are finite, are reduced by the absolute value of Tol, while the maximum values are increased by the same amount.
Parameters: Tol (float) – Return type: None
-
Get
()¶ - Returns the bounds of this bounding box. The gap is included. If this bounding box is infinite (i.e. ‘open’), returned values may be equal to +/- Precision::Infinite(). Standard_ConstructionError exception will be thrown if the box is void. if IsVoid()
Parameters: - theXmin (float &) –
- theYmin (float &) –
- theZmin (float &) –
- theXmax (float &) –
- theYmax (float &) –
- theZmax (float &) –
Return type:
-
IsOut
()¶ - Returns True if the Pnt is out the box.
Parameters: P (gp_Pnt) – Return type: bool - Returns False if the line intersects the box.
Parameters: L (gp_Lin) – Return type: bool - Returns False if the plane intersects the box.
Parameters: P (gp_Pln) – Return type: bool - Returns False if the <Box> intersects or is inside <self>.
Parameters: Other (Bnd_Box &) – Return type: bool - Returns False if the transformed <Box> intersects or is inside <self>.
Parameters: - Other (Bnd_Box &) –
- T (gp_Trsf) –
Return type: - Returns False if the transformed <Box> intersects or is inside the transformed box <self>.
Parameters: Return type: - Returns False if the flat band lying between two parallel lines represented by their reference points <P1>, <P2> and direction <D> intersects the box.
Parameters: Return type:
-
IsThin
()¶ - Returns true if IsXThin, IsYThin and IsZThin are all true, i.e. if the box is thin in all three dimensions.
Parameters: tol (float) – Return type: bool
-
IsWhole
()¶ - Returns true if this bounding box is infinite in all 6 directions (WholeSpace flag).
Return type: bool
-
Set
()¶ - Sets this bounding box so that it bounds - the point P. This involves first setting this bounding box to be void and then adding the point P.
Parameters: P (gp_Pnt) – Return type: None - Sets this bounding box so that it bounds the half-line defined by point P and direction D, i.e. all points M defined by M=P+u*D, where u is greater than or equal to 0, are inside the bounding volume. This involves first setting this box to be void and then adding the half-line.
Parameters: Return type:
-
SetVoid
()¶ - Sets this bounding box so that it is empty. All points are outside a void box.
Return type: None
-
SetWhole
()¶ - Sets this bounding box so that it covers the whole of 3D space. It is infinitely long in all directions.
Return type: None
-
Transformed
()¶ - Returns a bounding box which is the result of applying the transformation T to this bounding box. Warning Applying a geometric transformation (for example, a rotation) to a bounding box generally increases its dimensions. This is not optimal for algorithms which use it.
Parameters: T (gp_Trsf) – Return type: Bnd_Box
-
Update
()¶ - Enlarges this bounding box, if required, so that it contains at least: - interval [ aXmin,aXmax ] in the ‘X Direction’, - interval [ aYmin,aYmax ] in the ‘Y Direction’, - interval [ aZmin,aZmax ] in the ‘Z Direction’;
Parameters: Return type: - Adds a point of coordinates (X,Y,Z) to this bounding box.
Parameters: Return type:
-
thisown
¶ The membership flag
-
class
Bnd_Box2d
(*args)¶ Bases:
object
- Creates an empty 2D bounding box. The constructed box is qualified Void. Its gap is null.
Return type: None -
Add
()¶ - Adds the 2d box <Other> to <self>.
Parameters: Other (Bnd_Box2d &) – Return type: None - Adds the 2d pnt <P> to <self>.
Parameters: P (gp_Pnt2d) – Return type: None - Extends <self> from the Pnt <P> in the direction <D>.
Parameters: Return type: - Extends the Box in the given Direction, i.e. adds a half-line. The box may become infinite in 1 or 2 directions.
Parameters: D (gp_Dir2d) – Return type: None
-
Enlarge
()¶ - Enlarges the box with a tolerance value. This means that the minimum values of its X and Y intervals of definition, when they are finite, are reduced by the absolute value of Tol, while the maximum values are increased by the same amount.
Parameters: Tol (float) – Return type: None
-
Get
()¶ - Returns the bounds of this 2D bounding box. The gap is included. If this bounding box is infinite (i.e. ‘open’), returned values may be equal to +/- Precision::Infinite(). if IsVoid()
Parameters: - aXmin (float &) –
- aYmin (float &) –
- aXmax (float &) –
- aYmax (float &) –
Return type:
-
IsOut
()¶ - Returns True if the 2d pnt <P> is out <self>.
Parameters: P (gp_Pnt2d) – Return type: bool - Returns True if <Box2d> is out <self>.
Parameters: Other (Bnd_Box2d &) – Return type: bool - Returns True if transformed <Box2d> is out <self>.
Parameters: - Other (Bnd_Box2d &) –
- T (gp_Trsf2d) –
Return type: - Compares a transformed bounding with a transformed bounding. The default implementation is to make a copy of <self> and <Other>, to transform them and to test.
Parameters: Return type:
-
IsWhole
()¶ - Returns true if this bounding box is infinite in all 4 directions (Whole Space flag).
Return type: bool
-
Set
()¶ - Sets this 2D bounding box so that it bounds the point P. This involves first setting this bounding box to be void and then adding the point PThe rectangle bounds the point <P>.
Parameters: P (gp_Pnt2d) – Return type: None - Sets this 2D bounding box so that it bounds the half-line defined by point P and direction D, i.e. all points M defined by M=P+u*D, where u is greater than or equal to 0, are inside the bounding area. This involves first setting this 2D box to be void and then adding the half-line.
Parameters: Return type:
-
SetGap
()¶ - Set the gap of this 2D bounding box to abs(Tol).
Parameters: Tol (float) – Return type: None
-
SetVoid
()¶ - Sets this 2D bounding box so that it is empty. All points are outside a void box.
Return type: None
-
SetWhole
()¶ - Sets this bounding box so that it covers the whole 2D space, i.e. it is infinite in all directions.
Return type: None
-
Transformed
()¶ - Returns a bounding box which is the result of applying the transformation T to this bounding box. Warning Applying a geometric transformation (for example, a rotation) to a bounding box generally increases its dimensions. This is not optimal for algorithms which use it.
Parameters: T (gp_Trsf2d) – Return type: Bnd_Box2d
-
Update
()¶ - Enlarges this 2D bounding box, if required, so that it contains at least: - interval [ aXmin,aXmax ] in the ‘X Direction’, - interval [ aYmin,aYmax ] in the ‘Y Direction’
Parameters: Return type: - Adds a point of coordinates (X,Y) to this bounding box.
Parameters: Return type:
-
thisown
¶ The membership flag
-
class
Bnd_HArray1OfBox
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
Parameters: Return type: Return type: -
Array1
()¶ Return type: Bnd_Array1OfBox
-
ChangeArray1
()¶ Return type: Bnd_Array1OfBox
-
GetHandle
()¶
-
thisown
¶ The membership flag
-
-
class
Bnd_HArray1OfBox2d
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
Parameters: Return type: Return type: -
Array1
()¶ Return type: Bnd_Array1OfBox2d
-
ChangeArray1
()¶ Return type: Bnd_Array1OfBox2d
-
GetHandle
()¶
-
thisown
¶ The membership flag
-
-
class
Bnd_HArray1OfSphere
(*args)¶ Bases:
OCC.MMgt.MMgt_TShared
Parameters: Return type: Return type: -
Array1
()¶ Return type: Bnd_Array1OfSphere
-
ChangeArray1
()¶ Return type: Bnd_Array1OfSphere
-
ChangeValue
()¶ Parameters: Index (int) – Return type: Bnd_Sphere
-
GetHandle
()¶
-
Value
()¶ Parameters: Index (int) – Return type: Bnd_Sphere
-
thisown
¶ The membership flag
-
-
class
Bnd_SeqOfBox
(*args)¶ Bases:
OCC.TCollection.TCollection_BaseSequence
Return type: None Parameters: Other (Bnd_SeqOfBox &) – Return type: None -
Assign
()¶ Parameters: Other (Bnd_SeqOfBox &) – Return type: Bnd_SeqOfBox
-
InsertAfter
()¶ Parameters: - Index (int) –
- T (Bnd_Box &) –
- Index –
- S (Bnd_SeqOfBox &) –
Return type: Return type:
-
InsertBefore
()¶ Parameters: - Index (int) –
- T (Bnd_Box &) –
- Index –
- S (Bnd_SeqOfBox &) –
Return type: Return type:
-
Remove
()¶ Parameters: Return type: Return type:
-
Set
()¶ Parameters: Other (Bnd_SeqOfBox &) – Return type: Bnd_SeqOfBox
-
thisown
¶ The membership flag
-
-
class
Bnd_SequenceNodeOfSeqOfBox
(*args)¶ Bases:
OCC.TCollection.TCollection_SeqNode
Parameters: - I (Bnd_Box &) –
- n (TCollection_SeqNodePtr &) –
- p (TCollection_SeqNodePtr &) –
Return type: -
GetHandle
()¶
-
thisown
¶ The membership flag
-
class
Bnd_Sphere
(*args)¶ Bases:
object
- Empty constructor
Return type: None - Constructor of a definite sphere
Parameters: Return type: -
Distances
()¶ - Calculate and return minimal and maximal distance to sphere. NOTE: This function is tightly optimized; any modifications may affect performance!
Parameters: - theXYZ (gp_XYZ) –
- theMin (float &) –
- theMax (float &) –
Return type:
-
IsOut
()¶ Parameters: - theOther (Bnd_Sphere &) –
- thePnt (gp_XYZ) –
- theMaxDist (float &) –
Return type: Return type:
-
IsValid
()¶ - Returns validity status, indicating that this sphere corresponds to a real entity
Return type: bool
-
Project
()¶ - Projects a point on entity. Returns true if success
Parameters: Return type:
-
SquareDistances
()¶ - Calculate and return minimal and maximal distance to sphere. NOTE: This function is tightly optimized; any modifications may affect performance!
Parameters: - theXYZ (gp_XYZ) –
- theMin (float &) –
- theMax (float &) –
Return type:
-
thisown
¶ The membership flag
-
class
Handle_Bnd_HArray1OfBox
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Bnd_HArray1OfBox2d
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Bnd_HArray1OfSphere
(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Bnd_SequenceNodeOfSeqOfBox
(*args)¶ Bases:
OCC.TCollection.Handle_TCollection_SeqNode
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
SwigPyIterator
(*args, **kwargs)¶ Bases:
object
-
advance
()¶
-
copy
()¶
-
decr
()¶
-
distance
()¶
-
equal
()¶
-
incr
()¶
-
next
()¶
-
previous
()¶
-
thisown
¶ The membership flag
-
value
()¶
-
-
new_instancemethod
(func, inst, cls)¶
-
register_handle
(handle, base_object)¶ Inserts the handle into the base object to prevent memory corruption in certain cases