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

Analyzes a collection of 3D points to decide whether they are coincident, collinear, coplanar, or span 3D space, within a given tolerance. More...

#include <GProp_PEquation.hxx>

Public Types

enum class  Type {
  None , Point , Line , Plane ,
  Space
}
 Type of geometric entity that best fits the cloud. More...
 

Public Member Functions

 GProp_PEquation (const NCollection_Array1< gp_Pnt > &thePnts, double theTol)
 Constructs the analysis from a set of points and a tolerance.
 
Type GetType () const
 Returns the type of the fitted entity.
 
bool IsPlanar () const
 Returns true if points are coplanar within tolerance.
 
bool IsLinear () const
 Returns true if points are collinear within tolerance.
 
bool IsPoint () const
 Returns true if points are coincident within tolerance.
 
bool IsSpace () const
 Returns true if points span 3D space.
 
gp_Pln Plane () const
 Returns the mean plane.
 
gp_Lin Line () const
 Returns the mean line.
 
gp_Pnt Point () const
 Returns the mean point.
 
void Box (gp_Pnt &theP, gp_Vec &theV1, gp_Vec &theV2, gp_Vec &theV3) const
 Returns a bounding box aligned with the principal axes.
 
const gp_PntBarycentre () const
 Returns the centre of mass of the cloud (always valid after construction).
 
const gp_VecPrincipalAxis (int theIndex) const
 Returns the unit principal axis at theIndex (1, 2 or 3), ordered by eigenvalue.
 
double Extent (int theIndex) const
 Returns the extent (max - min projection) along principal axis theIndex (1, 2 or 3).
 

Detailed Description

Analyzes a collection of 3D points to decide whether they are coincident, collinear, coplanar, or span 3D space, within a given tolerance.

Uses principal-axis analysis (eigendecomposition of the inertia matrix) to determine the dimensionality of the cloud. Depending on the result type, the corresponding accessor (Point(), Line(), Plane() or Box()) returns the fitted geometric entity.

The raw PCA results (Barycentre(), PrincipalAxis(), Extent()) are always available regardless of the fitted type.

Member Enumeration Documentation

◆ Type

Type of geometric entity that best fits the cloud.

Enumerator
None 

Not yet computed.

Point 

All points are coincident within tolerance.

Line 

Points are collinear within tolerance.

Plane 

Points are coplanar within tolerance.

Space 

Points span 3D space.

Constructor & Destructor Documentation

◆ GProp_PEquation()

GProp_PEquation::GProp_PEquation ( const NCollection_Array1< gp_Pnt > & thePnts,
double theTol )

Constructs the analysis from a set of points and a tolerance.

Parameters
[in]thePntsarray of points to analyze
[in]theToltolerance for dimensional collapse detection

Member Function Documentation

◆ Barycentre()

const gp_Pnt & GProp_PEquation::Barycentre ( ) const
inline

Returns the centre of mass of the cloud (always valid after construction).

◆ Box()

void GProp_PEquation::Box ( gp_Pnt & theP,
gp_Vec & theV1,
gp_Vec & theV2,
gp_Vec & theV3 ) const

Returns a bounding box aligned with the principal axes.

Parameters
[out]thePcorner of the box (minimum projection on principal axes)
[out]theV1first box edge vector (along first principal axis)
[out]theV2second box edge vector (along second principal axis)
[out]theV3third box edge vector (along third principal axis)
Exceptions
Standard_NoSuchObjectif !IsSpace().

◆ Extent()

double GProp_PEquation::Extent ( int theIndex) const
inline

Returns the extent (max - min projection) along principal axis theIndex (1, 2 or 3).

◆ GetType()

Type GProp_PEquation::GetType ( ) const
inline

Returns the type of the fitted entity.

◆ IsLinear()

bool GProp_PEquation::IsLinear ( ) const
inline

Returns true if points are collinear within tolerance.

◆ IsPlanar()

bool GProp_PEquation::IsPlanar ( ) const
inline

Returns true if points are coplanar within tolerance.

◆ IsPoint()

bool GProp_PEquation::IsPoint ( ) const
inline

Returns true if points are coincident within tolerance.

◆ IsSpace()

bool GProp_PEquation::IsSpace ( ) const
inline

Returns true if points span 3D space.

◆ Line()

gp_Lin GProp_PEquation::Line ( ) const

Returns the mean line.

Exceptions
Standard_NoSuchObjectif !IsLinear().

◆ Plane()

gp_Pln GProp_PEquation::Plane ( ) const

Returns the mean plane.

Exceptions
Standard_NoSuchObjectif !IsPlanar().

◆ Point()

gp_Pnt GProp_PEquation::Point ( ) const

Returns the mean point.

Exceptions
Standard_NoSuchObjectif !IsPoint().

◆ PrincipalAxis()

const gp_Vec & GProp_PEquation::PrincipalAxis ( int theIndex) const
inline

Returns the unit principal axis at theIndex (1, 2 or 3), ordered by eigenvalue.


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