Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
GProp_PGProps Class Reference

Computes global properties (mass, barycentre, inertia matrix) of a weighted set of 3D points. More...

#include <GProp_PGProps.hxx>

Inheritance diagram for GProp_PGProps:
Inheritance graph
[legend]

Public Member Functions

 GProp_PGProps ()
 Creates an empty point set, located at the origin, with zero mass.
 
 GProp_PGProps (const NCollection_Array1< gp_Pnt > &thePnts)
 Creates a point set from an array of points (unit mass each).
 
 GProp_PGProps (const NCollection_Array2< gp_Pnt > &thePnts)
 Creates a point set from a 2D array of points (unit mass each).
 
 GProp_PGProps (const NCollection_Array1< gp_Pnt > &thePnts, const NCollection_Array1< double > &theDensity)
 Creates a point set from points and corresponding densities.
 
 GProp_PGProps (const NCollection_Array2< gp_Pnt > &thePnts, const NCollection_Array2< double > &theDensity)
 Creates a point set from 2D arrays of points and corresponding densities.
 
void AddPoint (const gp_Pnt &thePnt)
 Adds a point with unit mass.
 
void AddPoint (const gp_Pnt &thePnt, double theDensity)
 Adds a point with a given mass.
 
- Public Member Functions inherited from GProp_GProps
 GProp_GProps ()
 The origin (0, 0, 0) of the absolute Cartesian coordinate system is used to compute the global properties.
 
 GProp_GProps (const gp_Pnt &SystemLocation)
 The point SystemLocation is used to compute the global properties of the system. For greater accuracy, define this point close to the location of the system; for example a point near the centre of mass of the system.
 
void Add (const GProp_GProps &Item, const double Density=1.0)
 Either:
 
double Mass () const
 Returns the mass of the current system.
 
gp_Pnt CentreOfMass () const
 Returns the centre of mass of the current system. With a uniform gravitational field this is also the centre of gravity. The coordinates returned for the centre of mass are expressed in the absolute Cartesian coordinate system.
 
gp_Mat MatrixOfInertia () const
 Returns the matrix of inertia. It is a symmetric matrix whose coefficients are the quadratic moments of inertia:
 
void StaticMoments (double &Ix, double &Iy, double &Iz) const
 Returns the static moments of inertia of the current system - i.e. the moments of inertia about the three axes of the absolute Cartesian coordinate system.
 
double MomentOfInertia (const gp_Ax1 &A) const
 Computes the moment of inertia of the system about the axis A.
 
GProp_PrincipalProps PrincipalProperties () const
 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 coincides with the centre of mass of the system. The associated moments are called the principal moments of inertia.
 
double RadiusOfGyration (const gp_Ax1 &A) const
 Returns the radius of gyration of the current system about the axis A.
 

Static Public Member Functions

static gp_Pnt Barycentre (const NCollection_Array1< gp_Pnt > &thePnts)
 Computes the barycentre of a set of points (unit mass).
 
static gp_Pnt Barycentre (const NCollection_Array2< gp_Pnt > &thePnts)
 Computes the barycentre of a 2D array of points (unit mass).
 
static void Barycentre (const NCollection_Array1< gp_Pnt > &thePnts, const NCollection_Array1< double > &theDensity, double &theMass, gp_Pnt &theG)
 Computes the weighted barycentre and total mass of a set of points.
 
static void Barycentre (const NCollection_Array2< gp_Pnt > &thePnts, const NCollection_Array2< double > &theDensity, double &theMass, gp_Pnt &theG)
 Computes the weighted barycentre and total mass for a 2D point array.
 

Additional Inherited Members

- Protected Attributes inherited from GProp_GProps
gp_Pnt g
 Centre of mass (absolute frame)
 
gp_Pnt loc
 Reference point used for inertia accumulation.
 
double dim
 Total mass / length / area / volume.
 
gp_Mat inertia
 Quadratic moments of inertia matrix.
 

Detailed Description

Computes global properties (mass, barycentre, inertia matrix) of a weighted set of 3D points.

Each point carries a mass; by default the mass is unit. Contributions are accumulated incrementally via AddPoint() or from arrays passed to a constructor. As a GProp_GProps subclass, an instance can be composed into a larger system via GProp_GProps::Add().

Inertia is accumulated at the absolute origin and stored in the inherited GProp_GProps::inertia member, matching the legacy contract of this class.

Constructor & Destructor Documentation

◆ GProp_PGProps() [1/5]

GProp_PGProps::GProp_PGProps ( )

Creates an empty point set, located at the origin, with zero mass.

◆ GProp_PGProps() [2/5]

GProp_PGProps::GProp_PGProps ( const NCollection_Array1< gp_Pnt > & thePnts)
explicit

Creates a point set from an array of points (unit mass each).

◆ GProp_PGProps() [3/5]

GProp_PGProps::GProp_PGProps ( const NCollection_Array2< gp_Pnt > & thePnts)
explicit

Creates a point set from a 2D array of points (unit mass each).

◆ GProp_PGProps() [4/5]

GProp_PGProps::GProp_PGProps ( const NCollection_Array1< gp_Pnt > & thePnts,
const NCollection_Array1< double > & theDensity )

Creates a point set from points and corresponding densities.

Parameters
[in]thePntspoint array
[in]theDensityper-point mass array (same length as thePnts)
Exceptions
Standard_DomainErrorif a density <= gp::Resolution() or if the arrays have different lengths.

◆ GProp_PGProps() [5/5]

GProp_PGProps::GProp_PGProps ( const NCollection_Array2< gp_Pnt > & thePnts,
const NCollection_Array2< double > & theDensity )

Creates a point set from 2D arrays of points and corresponding densities.

Parameters
[in]thePntspoint array
[in]theDensityper-point mass array (same dimensions as thePnts)
Exceptions
Standard_DomainErroron dimension mismatch or non-positive density.

Member Function Documentation

◆ AddPoint() [1/2]

void GProp_PGProps::AddPoint ( const gp_Pnt & thePnt)

Adds a point with unit mass.

◆ AddPoint() [2/2]

void GProp_PGProps::AddPoint ( const gp_Pnt & thePnt,
double theDensity )

Adds a point with a given mass.

Exceptions
Standard_DomainErrorif theDensity <= gp::Resolution().

◆ Barycentre() [1/4]

static gp_Pnt GProp_PGProps::Barycentre ( const NCollection_Array1< gp_Pnt > & thePnts)
static

Computes the barycentre of a set of points (unit mass).

◆ Barycentre() [2/4]

static void GProp_PGProps::Barycentre ( const NCollection_Array1< gp_Pnt > & thePnts,
const NCollection_Array1< double > & theDensity,
double & theMass,
gp_Pnt & theG )
static

Computes the weighted barycentre and total mass of a set of points.

Parameters
[in]thePntspoint array
[in]theDensityper-point mass array
[out]theMasstotal mass (sum of densities)
[out]theGweighted barycentre
Exceptions
Standard_DimensionErroron length mismatch.

◆ Barycentre() [3/4]

static gp_Pnt GProp_PGProps::Barycentre ( const NCollection_Array2< gp_Pnt > & thePnts)
static

Computes the barycentre of a 2D array of points (unit mass).

◆ Barycentre() [4/4]

static void GProp_PGProps::Barycentre ( const NCollection_Array2< gp_Pnt > & thePnts,
const NCollection_Array2< double > & theDensity,
double & theMass,
gp_Pnt & theG )
static

Computes the weighted barycentre and total mass for a 2D point array.

Exceptions
Standard_DimensionErroron dimension mismatch.

The documentation for this class was generated from the following file: