CVB++ 14.1
Plane3D Class Referencefinal

A plane in 3D space in Hessian normal form. More...

#include <cvb/plane_3d.hpp>

Public Member Functions

 Plane3D () noexcept=default
 Creates a default plane at (0, 0, 0, 0). More...
 
 Plane3D (double nx, double ny, double nz, double distanceToOrigin) noexcept
 Creates a new Plane3D object from the given normal vector components and the distanceToOrigin. More...
 
 Plane3D (Point3D< double > normal, double distanceToOrigin) noexcept
 Creates a new Plane3D object. More...
 
Point3D< double > Normal () const noexcept
 Gets the normal vector of the plane. More...
 
void SetNormal (Point3D< double > normal) noexcept
 Sets the normal vector of the plane. More...
 
double DistanceToOrigin () const noexcept
 Gets the distance to the origin in point units. More...
 
void SetDistanceToOrigin (double distanceToOrigin) noexcept
 Sets the distance to the origin in point units. More...
 
double DistanceToPoint (const Point3D< double > &pt) const noexcept
 Calculates the distance to the point pt. More...
 
double DistanceToPoint (double x, double y, double z) const noexcept
 Calculates the distance to the point pt. More...
 
AffineMatrix3D AlignToXYPlane ()
 Calculates a rigid body transformation that maps the plane into the xy plane of the global coordinate system. More...
 

Detailed Description

A plane in 3D space in Hessian normal form.

Examples
Cvb/CppPointCloudCreateCalibrated.

Constructor & Destructor Documentation

◆ Plane3D() [1/3]

Plane3D ( )
defaultnoexcept

Creates a default plane at (0, 0, 0, 0).

Exceptions
Doesnot throw any exception.

◆ Plane3D() [2/3]

Plane3D ( double  nx,
double  ny,
double  nz,
double  distanceToOrigin 
)
inlinenoexcept

Creates a new Plane3D object from the given normal vector components and the distanceToOrigin.

Parameters
[in]nxNormal vector x component.
[in]nyNormal vector y component.
[in]nzNormal vector z component.
[in]distanceToOriginDistance to origin in point units.
Exceptions
Doesnot throw any exception.

◆ Plane3D() [3/3]

Plane3D ( Point3D< double >  normal,
double  distanceToOrigin 
)
inlinenoexcept

Creates a new Plane3D object.

Parameters
[in]normalThree dimensional point.
[in]distanceToOriginDistance to origin in point units.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ AlignToXYPlane()

AffineMatrix3D AlignToXYPlane ( )
inline

Calculates a rigid body transformation that maps the plane into the xy plane of the global coordinate system.

If a point cloud contains a tilted plane (e.g. representing a conveyer belt), which is not aligned to the xy plane, the following steps should be taken:

  1. Calulate a plane fit on the data using function FitPlane.
  2. Align the output plane to the xy plane with AlignToXYPlane.

Please note the following:

  • The transformation includes only a rotation about x and y axis. The resulting transformation will not contain any rotation about the global Z-axis.
  • The translation to the origin of the global coordinate system is done along z axis.

    Returns
    Calculated transformation to move the plane to xy plane.
    Exceptions
    Anyexception derived from std::exception including CvbException.

◆ DistanceToOrigin()

double DistanceToOrigin ( ) const
inlinenoexcept

Gets the distance to the origin in point units.

Returns
distance to the origin in point units.
Exceptions
Doesnot throw any exception.

◆ DistanceToPoint() [1/2]

double DistanceToPoint ( const Point3D< double > &  pt) const
inlinenoexcept

Calculates the distance to the point pt.

Parameters
[in]ptPoint to calculate the distance to.
Returns
Distance of point pt to this plane.
Exceptions
Doesnot throw any exception.

◆ DistanceToPoint() [2/2]

double DistanceToPoint ( double  x,
double  y,
double  z 
) const
inlinenoexcept

Calculates the distance to the point pt.

Parameters
[in]xPoint x component.
[in]yPoint y component.
[in]zPoint z component.
Returns
Distance of point pt to this plane.
Exceptions
Doesnot throw any exception.

◆ Normal()

Point3D< double > Normal ( ) const
inlinenoexcept

Gets the normal vector of the plane.

Returns
normal vector.
Exceptions
Doesnot throw any exception.

◆ SetDistanceToOrigin()

void SetDistanceToOrigin ( double  distanceToOrigin)
inlinenoexcept

Sets the distance to the origin in point units.

Parameters
[in]distanceToOriginto the origin in point units.
Exceptions
Doesnot throw any exception.

◆ SetNormal()

void SetNormal ( Point3D< double >  normal)
inlinenoexcept

Sets the normal vector of the plane.

Parameters
[in]normalvector.
Exceptions
Doesnot throw any exception.