OCC.GProp module¶

class
GProp_CelGProps
(*args)¶ Bases:
OCC.GProp.GProp_GProps
Return type: Parameters: Return type: Return type: Return type: 
Perform
()¶ Parameters: Return type: Return type:

thisown
¶ The membership flag


class
GProp_GProps
(*args)¶ Bases:
object
 The origin (0, 0, 0) of the absolute cartesian coordinate system is used to compute the global properties.
Return type: None  The point SystemLocation is used to compute the gobal properties of the system. For more accuracy it is better to define this point closed to the location of the system. For example it could be a point around the centre of mass of the system. This point is referred to as the reference point for this framework. For greater accuracy it is better for the reference point to be close to the location of the system. It can, for example, be a point near the center of mass of the system. At initialization, the framework is empty; i.e. it retains no dimensional information such as mass, or inertia. However, it is now able to bring together global properties of various other systems, whose global properties have already been computed using another framework. To do this, use the function Add to define the components of the system. Use it once per component of the system, and then use the interrogation functions available to access the computed values.
Parameters: SystemLocation (gp_Pnt) – Return type: None 
Add
()¶  Either  initializes the global properties retained by this framework from those retained by the framework Item, or  brings together the global properties still retained by this framework with those retained by the framework Item. The value Density, which is 1.0 by default, is used as the density of the system analysed by Item. Sometimes the density will have already been given at the time of construction of the framework Item. This may be the case for example, if Item is a GProp_PGProps framework built to compute the global properties of a set of points ; or another GProp_GProps object which already retains composite global properties. In these cases the real density was perhaps already taken into account at the time of construction of Item. Note that this is not checked: if the density of parts of the system is taken into account two or more times, results of the computation will be false. Notes :  The point relative to which the inertia of Item is computed (i.e. the reference point of Item) may be different from the reference point in this framework. Huygens’ theorem is applied automatically to transfer inertia values to the reference point in this framework.  The function Add is used once per component of the system. After that, you use the interrogation functions available to access values computed for the system.  The system whose global properties are already brought together by this framework is referred to as the current system. However, the current system is not retained by this framework, which maintains only its global properties. Exceptions Standard_DomainError if Density is less than or equal to gp::Resolution().
Parameters:  Item (GProp_GProps &) –
 Density (float) – default value is 1.0
Return type:

CentreOfMass
()¶  Returns the center of mass of the current system. If the gravitational field is uniform, it is the center of gravity. The coordinates returned for the center of mass are expressed in the absolute Cartesian coordinate system.
Return type: gp_Pnt

Mass
()¶  Returns the mass of the current system. If no density is attached to the components of the current system the returned value corresponds to :  the total length of the edges of the current system if this framework retains only linear properties, as is the case for example, when using only the LinearProperties function to combine properties of lines from shapes, or  the total area of the faces of the current system if this framework retains only surface properties, as is the case for example, when using only the SurfaceProperties function to combine properties of surfaces from shapes, or  the total volume of the solids of the current system if this framework retains only volume properties, as is the case for example, when using only the VolumeProperties function to combine properties of volumes from solids. Warning A length, an area, or a volume is computed in the current data unit system. The mass of a single object is obtained by multiplying its length, its area or its volume by the given density. You must be consistent with respect to the units used.
Return type: float

MatrixOfInertia
()¶  returns the matrix of inertia. It is a symmetrical matrix. The coefficients of the matrix are the quadratic moments of inertia. //!  Ixx Ixy Ixz  matrix =  Ixy Iyy Iyz   Ixz Iyz Izz  //! The moments of inertia are denoted by Ixx, Iyy, Izz. The products of inertia are denoted by Ixy, Ixz, Iyz. The matrix of inertia is returned in the central coordinate system (G, Gx, Gy, Gz) where G is the centre of mass of the system and Gx, Gy, Gz the directions parallel to the X(1,0,0) Y(0,1,0) Z(0,0,1) directions of the absolute cartesian coordinate system. It is possible to compute the matrix of inertia at another location point using the Huyghens theorem (you can use the method of package GProp : HOperator).
Return type: gp_Mat

MomentOfInertia
()¶  computes the moment of inertia of the material system about the axis A.
Parameters: A (gp_Ax1) – Return type: float

PrincipalProperties
()¶  Computes the principal properties of inertia of the current system. There is always a set of axes for which the products of inertia of a geometric system are equal to 0; i.e. the matrix of inertia of the system is diagonal. These axes are the principal axes of inertia. Their origin is coincident with the center of mass of the system. The associated moments are called the principal moments of inertia. This function computes the eigen values and the eigen vectors of the matrix of inertia of the system. Results are stored by using a presentation framework of principal properties of inertia (GProp_PrincipalProps object) which may be queried to access the value sought.
Return type: GProp_PrincipalProps

RadiusOfGyration
()¶  Returns the radius of gyration of the current system about the axis A.
Parameters: A (gp_Ax1) – Return type: float

StaticMoments
()¶  Returns Ix, Iy, Iz, the static moments of inertia of the current system; i.e. the moments of inertia about the three axes of the Cartesian coordinate system.
Parameters:  Ix (float &) –
 Iy (float &) –
 Iz (float &) –
Return type:

thisown
¶ The membership flag

class
GProp_PEquation
(*args)¶ Bases:
object
 Constructs a framework to analyze the collection of points Pnts and computes:  the mean point if the points in question are considered to be coincident within the precision Tol, or  the mean line if they are considered to be collinear within the precision Tol, or  the mean plane if they are considered to be coplanar within the precision Tol, or  the minimal box which contains all the points. Use :  the functions IsPoint, IsLinear, IsPlanar and IsSpace to find the result of the analysis, and  the function Point, Line, Plane or Box to access the computed result.
Parameters:  Pnts (TColgp_Array1OfPnt) –
 Tol (float) –
Return type: 
Box
()¶  Returns the definition of the smallest box which contains all the points analyzed by this framework if, according to the given precision value, the points are considered to be neither coincident, nor collinear and nor coplanar. This box is centered on the barycenter P of the collection of points. Its sides are parallel to the three vectors V1, V2 and V3, the length of which is the length of the box in the corresponding direction. Note: Vectors V1, V2 and V3 are parallel to the three axes of principal inertia of the system composed of the collection of points where each point is of equal mass. Exceptions Standard_NoSuchObject if, according to the given precision, the points analyzed by this framework are considered to be coincident, collinear or coplanar.
Parameters: Return type:

IsLinear
()¶  Returns true if, according to the given tolerance, the points analyzed by this framework are colinear. Use the function Line to access the computed result.
Return type: bool

IsPlanar
()¶  Returns true if, according to the given tolerance, the points analyzed by this framework are coplanar. Use the function Plane to access the computed result.
Return type: bool

IsPoint
()¶  Returns true if, according to the given tolerance, the points analyzed by this framework are coincident. Use the function Point to access the computed result.
Return type: bool

IsSpace
()¶  Returns true if, according to the given tolerance value, the points analyzed by this framework are neither coincident, nor collinear, nor coplanar. Use the function Box to query the smallest box that includes the collection of points.
Return type: bool

Line
()¶  Returns the mean line passing near all the points analyzed by this framework if, according to the given precision value, the points are considered to be collinear. Exceptions Standard_NoSuchObject if, according to the given precision, the points analyzed by this framework are considered to be:  coincident, or  not collinear.
Return type: gp_Lin

Plane
()¶  Returns the mean plane passing near all the points analyzed by this framework if, according to the given precision, the points are considered to be coplanar. Exceptions Standard_NoSuchObject if, according to the given precision value, the points analyzed by this framework are considered to be:  coincident, or  collinear, or  not coplanar.
Return type: gp_Pln

Point
()¶  Returns the mean point of all the points analyzed by this framework if, according to the given precision, the points are considered to be coincident. Exceptions Standard_NoSuchObject if, according to the given precision, the points analyzed by this framework are not considered to be coincident.
Return type: gp_Pnt

thisown
¶ The membership flag

class
GProp_PGProps
(*args)¶ Bases:
OCC.GProp.GProp_GProps
 Initializes a framework to compute global properties on a set of points. The point relative to which the inertia of the system is computed will be the origin (0, 0, 0) of the absolute Cartesian coordinate system. At initialization, the framework is empty, i.e. it retains no dimensional information such as mass and inertia. It is, however, now able to keep global properties of a set of points while new points are added using the AddPoint function. The set of points whose global properties are brought together by this framework will then be referred to as the current system. The current system is, however, not kept by this framework, which only keeps that system’s global properties. Note that the current system may be more complex than a set of points.
Return type: None  computes the global properties of the system of points Pnts. The density of the points are defaulted to all being 1
Parameters: Pnts (TColgp_Array1OfPnt) – Return type: None  computes the global properties of the system of points Pnts. The density of the points are defaulted to all being 1
Parameters: Pnts (TColgp_Array2OfPnt) – Return type: None  computes the global properties of the system of points Pnts. A density is associated with each point. //! raises if a density is lower or equal to Resolution from package gp. //! raises if the length of Pnts and the length of Density is not the same.
Parameters:  Pnts (TColgp_Array1OfPnt) –
 Density (TColStd_Array1OfReal &) –
Return type:  computes the global properties of the system of points Pnts. A density is associated with each point. //! Raised if a density is lower or equal to Resolution from package gp. //! Raised if the length of Pnts and the length of Density is not the same.
Parameters:  Pnts (TColgp_Array2OfPnt) –
 Density (TColStd_Array2OfReal &) –
Return type: 
AddPoint
()¶  Brings together the global properties already retained by this framework with those induced by the point Pnt. Pnt may be the first point of the current system. A point mass is attached to the point Pnt, it is either equal to 1. or to Density.
Parameters: P (gp_Pnt) – Return type: None  Adds a new point P with its density in the system of points Exceptions Standard_DomainError if the mass value Density is less than gp::Resolution().
Parameters: Return type:

static
Barycentre
(*args)¶  Computes the barycentre of a set of points. The density of the points is defaulted to 1.
Parameters: Pnts (TColgp_Array1OfPnt) – Return type: gp_Pnt  Computes the barycentre of a set of points. The density of the points is defaulted to 1.
Parameters: Pnts (TColgp_Array2OfPnt) – Return type: gp_Pnt  Computes the barycentre of a set of points. A density is associated with each point. //! raises if a density is lower or equal to Resolution from package gp. //! Raised if the length of Pnts and the length of Density is not the same.
Parameters:  Pnts (TColgp_Array1OfPnt) –
 Density (TColStd_Array1OfReal &) –
 Mass (float &) –
 G (gp_Pnt) –
Return type: void
 Computes the barycentre of a set of points. A density is associated with each point. //! Raised if a density is lower or equal to Resolution from package gp. //! Raised if the length of Pnts and the length of Density is not the same.
Parameters:  Pnts (TColgp_Array2OfPnt) –
 Density (TColStd_Array2OfReal &) –
 Mass (float &) –
 G (gp_Pnt) –
Return type: void

thisown
¶ The membership flag

GProp_PGProps_Barycentre
(*args)¶  Computes the barycentre of a set of points. The density of the points is defaulted to 1.
Parameters: Pnts (TColgp_Array1OfPnt) – Return type: gp_Pnt  Computes the barycentre of a set of points. The density of the points is defaulted to 1.
Parameters: Pnts (TColgp_Array2OfPnt) – Return type: gp_Pnt  Computes the barycentre of a set of points. A density is associated with each point. //! raises if a density is lower or equal to Resolution from package gp. //! Raised if the length of Pnts and the length of Density is not the same.
Parameters:  Pnts (TColgp_Array1OfPnt) –
 Density (TColStd_Array1OfReal &) –
 Mass (float &) –
 G (gp_Pnt) –
Return type: void
 Computes the barycentre of a set of points. A density is associated with each point. //! Raised if a density is lower or equal to Resolution from package gp. //! Raised if the length of Pnts and the length of Density is not the same.
Parameters:  Pnts (TColgp_Array2OfPnt) –
 Density (TColStd_Array2OfReal &) –
 Mass (float &) –
 G (gp_Pnt) –
Return type: void

class
GProp_PrincipalProps
(*args)¶ Bases:
object
 creates an undefined PrincipalProps.
Return type: None 
FirstAxisOfInertia
()¶  returns the first axis of inertia. //! if the system has a point of symmetry there is an infinity of solutions. It is not possible to defines the three axis of inertia.
Return type: gp_Vec

HasSymmetryAxis
()¶  returns true if the geometric system has an axis of symmetry. For comparing moments relative tolerance 1.e10 is used. Usually it is enough for objects, restricted by faces with analitycal geometry.
Return type: bool  returns true if the geometric system has an axis of symmetry. aTol is relative tolerance for cheking equality of moments If aTol == 0, relative tolerance is ~ 1.e16 (Epsilon(I))
Parameters: aTol (float) – Return type: bool

HasSymmetryPoint
()¶  returns true if the geometric system has a point of symmetry. For comparing moments relative tolerance 1.e10 is used. Usually it is enough for objects, restricted by faces with analitycal geometry.
Return type: bool  returns true if the geometric system has a point of symmetry. aTol is relative tolerance for cheking equality of moments If aTol == 0, relative tolerance is ~ 1.e16 (Epsilon(I))
Parameters: aTol (float) – Return type: bool

Moments
()¶  Ixx, Iyy and Izz return the principal moments of inertia in the current system. Notes :  If the current system has an axis of symmetry, two of the three values Ixx, Iyy and Izz are equal. They indicate which eigen vectors define an infinity of axes of principal inertia.  If the current system has a center of symmetry, Ixx, Iyy and Izz are equal.
Parameters:  Ixx (float &) –
 Iyy (float &) –
 Izz (float &) –
Return type:

RadiusOfGyration
()¶  Returns the principal radii of gyration Rxx, Ryy and Rzz are the radii of gyration of the current system about its three principal axes of inertia. Note that:  If the current system has an axis of symmetry, two of the three values Rxx, Ryy and Rzz are equal.  If the current system has a center of symmetry, Rxx, Ryy and Rzz are equal.
Parameters:  Rxx (float &) –
 Ryy (float &) –
 Rzz (float &) –
Return type:

SecondAxisOfInertia
()¶  returns the second axis of inertia. //! if the system has a point of symmetry or an axis of symmetry the second and the third axis of symmetry are undefined.
Return type: gp_Vec

ThirdAxisOfInertia
()¶  returns the third axis of inertia. This and the above functions return the first, second or third eigen vector of the matrix of inertia of the current system. The first, second and third principal axis of inertia pass through the center of mass of the current system. They are respectively parallel to these three eigen vectors. Note that:  If the current system has an axis of symmetry, any axis is an axis of principal inertia if it passes through the center of mass of the system, and runs parallel to a linear combination of the two eigen vectors of the matrix of inertia, corresponding to the two eigen values which are equal. If the current system has a center of symmetry, any axis passing through the center of mass of the system is an axis of principal inertia. Use the functions HasSymmetryAxis and HasSymmetryPoint to check these particular cases, where the returned eigen vectors define an infinity of principal axis of inertia.  The Moments function can be used to know which of the three eigen vectors corresponds to the two eigen values which are equal. //! if the system has a point of symmetry or an axis of symmetry the second and the third axis of symmetry are undefined.
Return type: gp_Vec

thisown
¶ The membership flag

class
GProp_SelGProps
(*args)¶ Bases:
OCC.GProp.GProp_GProps
Return type: Parameters: Return type: Return type: Return type: Return type: 
Perform
()¶ Parameters: Return type: Return type: Return type: Return type:

thisown
¶ The membership flag


class
GProp_VelGProps
(*args)¶ Bases:
OCC.GProp.GProp_GProps
Return type: Parameters: Return type: Return type: Return type: Return type: 
Perform
()¶ Parameters: Return type: Return type: Return type: Return type:

thisown
¶ The membership flag


class
SwigPyIterator
(*args, **kwargs)¶ Bases:
object

advance
()¶

copy
()¶

decr
()¶

distance
()¶

equal
()¶

incr
()¶

next
()¶

previous
()¶

thisown
¶ The membership flag

value
()¶


class
gprop
¶ Bases:
object

static
HOperator
(*args)¶  methods of package Computes the matrix Operator, referred to as the ‘Huyghens Operator’ of a geometric system at the point Q of the space, using the following data :  Mass, i.e. the mass of the system,  G, the center of mass of the system. The ‘Huyghens Operator’ is used to compute Inertia/Q, the matrix of inertia of the system at the point Q using Huyghens’ theorem : Inertia/Q = Inertia/G + HOperator (Q, G, Mass) where Inertia/G is the matrix of inertia of the system relative to its center of mass as returned by the function MatrixOfInertia on any GProp_GProps object.
Parameters: Return type: void

thisown
¶ The membership flag

static

gprop_HOperator
(*args)¶  methods of package Computes the matrix Operator, referred to as the ‘Huyghens Operator’ of a geometric system at the point Q of the space, using the following data :  Mass, i.e. the mass of the system,  G, the center of mass of the system. The ‘Huyghens Operator’ is used to compute Inertia/Q, the matrix of inertia of the system at the point Q using Huyghens’ theorem : Inertia/Q = Inertia/G + HOperator (Q, G, Mass) where Inertia/G is the matrix of inertia of the system relative to its center of mass as returned by the function MatrixOfInertia on any GProp_GProps object.
Parameters: Return type: void

register_handle
(handle, base_object)¶ Inserts the handle into the base object to prevent memory corruption in certain cases