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

#include <MRPointToPlaneAligningTransform.h>

Public Member Functions

MRMESH_API void add (const Vector3d &p1, const Vector3d &p2, const Vector3d &normal2, double w=1)
 Add a pair of corresponding points and the normal of the tangent plane at the second point.
 
void add (const Vector3f &p1, const Vector3f &p2, const Vector3f &normal2, float w=1)
 Add a pair of corresponding points and the normal of the tangent plane at the second point.
 
MRMESH_API void prepare ()
 this method must be called after add() and before constant find...()/calculate...() to make the matrix symmetric
 
void clear ()
 Clear points and normals data.
 
AffineXf3d findBestRigidXf () const
 
AffineXf3d findBestRigidScaleXf () const
 this version searches for best rigid body transformation with uniform scaling
 
AffineXf3d findBestRigidXfFixedRotationAxis (const Vector3d &axis) const
 this version searches for best transformation where rotation is allowed only around given axis and with arbitrary translation
 
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 (Vector3d rotAngles={}, double scale=1) const
 this version searches for best translational part of affine transformation with given linear part
 
MRMESH_API RigidScaleXf3d calculateAmendment () const
 Compute transformation relative to given approximation and return it as angles and shift (scale = 1)
 
MRMESH_API RigidScaleXf3d calculateAmendmentWithScale () const
 Compute transformation relative to given approximation and return it as scale, angles and shift.
 
MRMESH_API RigidScaleXf3d calculateFixedAxisAmendment (const Vector3d &axis) const
 this version searches for best transformation where rotation is allowed only around given axis and with arbitrary translation
 
MRMESH_API RigidScaleXf3d calculateOrthogonalAxisAmendment (const Vector3d &ort) const
 this version searches for best transformation where rotation is allowed only around axes orthogonal to given one
 

Detailed Description

This class and its main method can be used to solve the problem of 3D shape alignment. This algorithm uses a point-to-plane error metric in which the object of minimization is the sum of the squared distance between a point and the tangent plane at its correspondence point. To use this technique it's need to have small rotation angles. So there is an approximate solution. The result of this algorithm is the transformation of first points (p1) which aligns it to the second ones (p2).

Member Function Documentation

◆ add() [1/2]

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

Add a pair of corresponding points and the normal of the tangent plane at the second point.

◆ add() [2/2]

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

Add a pair of corresponding points and the normal of the tangent plane at the second point.

◆ calculateAmendment()

MRMESH_API RigidScaleXf3d MR::PointToPlaneAligningTransform::calculateAmendment ( ) const
nodiscard

Compute transformation relative to given approximation and return it as angles and shift (scale = 1)

◆ calculateAmendmentWithScale()

MRMESH_API RigidScaleXf3d MR::PointToPlaneAligningTransform::calculateAmendmentWithScale ( ) const
nodiscard

Compute transformation relative to given approximation and return it as scale, angles and shift.

◆ calculateFixedAxisAmendment()

MRMESH_API RigidScaleXf3d MR::PointToPlaneAligningTransform::calculateFixedAxisAmendment ( const Vector3d & axis) const
nodiscard

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

◆ calculateOrthogonalAxisAmendment()

MRMESH_API RigidScaleXf3d MR::PointToPlaneAligningTransform::calculateOrthogonalAxisAmendment ( const Vector3d & ort) const
nodiscard

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

◆ clear()

void MR::PointToPlaneAligningTransform::clear ( )
inline

Clear points and normals data.

◆ findBestRigidScaleXf()

AffineXf3d MR::PointToPlaneAligningTransform::findBestRigidScaleXf ( ) const
inlinenodiscard

this version searches for best rigid body transformation with uniform scaling

◆ findBestRigidXf()

AffineXf3d MR::PointToPlaneAligningTransform::findBestRigidXf ( ) const
inlinenodiscard

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

◆ findBestRigidXfFixedRotationAxis()

AffineXf3d MR::PointToPlaneAligningTransform::findBestRigidXfFixedRotationAxis ( const Vector3d & axis) const
inlinenodiscard

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

◆ findBestRigidXfOrthogonalRotationAxis()

AffineXf3d MR::PointToPlaneAligningTransform::findBestRigidXfOrthogonalRotationAxis ( const Vector3d & ort) const
inlinenodiscard

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

◆ findBestTranslation()

MRMESH_API Vector3d MR::PointToPlaneAligningTransform::findBestTranslation ( Vector3d rotAngles = {},
double scale = 1 ) const
nodiscard

this version searches for best translational part of affine transformation with given linear part

◆ prepare()

MRMESH_API void MR::PointToPlaneAligningTransform::prepare ( )

this method must be called after add() and before constant find...()/calculate...() to make the matrix symmetric


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