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>
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.
◆ 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.
|
◆ GProp_PEquation()
Constructs the analysis from a set of points and a tolerance.
- Parameters
-
| [in] | thePnts | array of points to analyze |
| [in] | theTol | tolerance for dimensional collapse detection |
◆ Barycentre()
| const gp_Pnt & GProp_PEquation::Barycentre |
( |
| ) |
const |
|
inline |
Returns the centre of mass of the cloud (always valid after construction).
◆ Box()
Returns a bounding box aligned with the principal axes.
- Parameters
-
| [out] | theP | corner of the box (minimum projection on principal axes) |
| [out] | theV1 | first box edge vector (along first principal axis) |
| [out] | theV2 | second box edge vector (along second principal axis) |
| [out] | theV3 | third box edge vector (along third principal axis) |
- Exceptions
-
| Standard_NoSuchObject | if !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_NoSuchObject | if !IsLinear(). |
◆ Plane()
| gp_Pln GProp_PEquation::Plane |
( |
| ) |
const |
Returns the mean plane.
- Exceptions
-
| Standard_NoSuchObject | if !IsPlanar(). |
◆ Point()
| gp_Pnt GProp_PEquation::Point |
( |
| ) |
const |
Returns the mean point.
- Exceptions
-
| Standard_NoSuchObject | if !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: