MeshLib Documentation
Loading...
Searching...
No Matches
MR::PointToPointAligningTransform Class Reference

#include <MRPointToPointAligningTransform.h>

Public Member Functions

MRMESH_API void add (const Vector3d &p1, const Vector3d &p2, double w=1)
 Add one pair of points in the set.
 
void add (const Vector3f &p1, const Vector3f &p2, float w=1)
 Add one pair of points in the set.
 
MRMESH_API void add (const PointToPointAligningTransform &other)
 Add another two sets of points.
 
void clear ()
 Clear sets.
 
Vector3d centroid1 () const
 returns weighted centroid of points p1 accumulated so far
 
Vector3d centroid2 () const
 returns weighted centroid of points p2 accumulated so far
 
double totalWeight () const
 returns summed weight of points accumulated so far
 
MRMESH_API AffineXf3d findBestRigidXf () const
 
MRMESH_API AffineXf3d findBestRigidScaleXf () const
 this version searches for best rigid body transformation with uniform scaling
 
MRMESH_API AffineXf3d findBestRigidXfFixedRotationAxis (const Vector3d &axis) const
 this version searches for best transformation where rotation is allowed only around given axis and with arbitrary translation
 
MRMESH_API AffineXf3d findBestRigidXfOrthogonalRotationAxis (const Vector3d &ort) const
 this version searches for best transformation where rotation is allowed only around axes orthogonal to given one
 
MRMESH_API Vector3d findBestTranslation () const
 Simplified solution for translational part only.
 

Detailed Description

This class and its main method can be used to solve the problem well-known as the absolute orientation problem. It means computing the transformation that aligns two sets of points for which correspondence is known.

Member Function Documentation

◆ add() [1/3]

MRMESH_API void MR::PointToPointAligningTransform::add ( const PointToPointAligningTransform & other)

Add another two sets of points.

◆ add() [2/3]

MRMESH_API void MR::PointToPointAligningTransform::add ( const Vector3d & p1,
const Vector3d & p2,
double w = 1 )

Add one pair of points in the set.

◆ add() [3/3]

void MR::PointToPointAligningTransform::add ( const Vector3f & p1,
const Vector3f & p2,
float w = 1 )
inline

Add one pair of points in the set.

◆ centroid1()

Vector3d MR::PointToPointAligningTransform::centroid1 ( ) const
inlinenodiscard

returns weighted centroid of points p1 accumulated so far

◆ centroid2()

Vector3d MR::PointToPointAligningTransform::centroid2 ( ) const
inlinenodiscard

returns weighted centroid of points p2 accumulated so far

◆ clear()

void MR::PointToPointAligningTransform::clear ( )
inline

Clear sets.

◆ findBestRigidScaleXf()

MRMESH_API AffineXf3d MR::PointToPointAligningTransform::findBestRigidScaleXf ( ) const
nodiscard

this version searches for best rigid body transformation with uniform scaling

◆ findBestRigidXf()

MRMESH_API AffineXf3d MR::PointToPointAligningTransform::findBestRigidXf ( ) const
nodiscard

Compute transformation as the solution to a least squares formulation of the problem: xf( p1_i ) = p2_i this version searches for best rigid body transformation

◆ findBestRigidXfFixedRotationAxis()

MRMESH_API AffineXf3d MR::PointToPointAligningTransform::findBestRigidXfFixedRotationAxis ( const Vector3d & axis) const
nodiscard

this version searches for best transformation where rotation is allowed only around given axis and with arbitrary translation

◆ findBestRigidXfOrthogonalRotationAxis()

MRMESH_API AffineXf3d MR::PointToPointAligningTransform::findBestRigidXfOrthogonalRotationAxis ( const Vector3d & ort) const
nodiscard

this version searches for best transformation where rotation is allowed only around axes orthogonal to given one

◆ findBestTranslation()

MRMESH_API Vector3d MR::PointToPointAligningTransform::findBestTranslation ( ) const
nodiscard

Simplified solution for translational part only.

◆ totalWeight()

double MR::PointToPointAligningTransform::totalWeight ( ) const
inlinenodiscard

returns summed weight of points accumulated so far


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