MRPT  2.0.4
List of all members | Public Member Functions | Public Attributes
mrpt::math::TPlane Struct Reference

Detailed Description

3D Plane, represented by its equation $Ax+By+Cz+D=0$

See also
TSegment3D,TLine3D,TPolygon3D,TPoint3D

Definition at line 22 of file TPlane.h.

#include <mrpt/math/TPlane.h>

Public Member Functions

double evaluatePoint (const TPoint3D &point) const
 Evaluate a point in the plane's equation. More...
 
bool contains (const TPoint3D &point) const
 Check whether a point is contained into the plane. More...
 
bool contains (const TSegment3D &segment) const
 Check whether a segment is fully contained into the plane. More...
 
bool contains (const TLine3D &line) const
 Check whether a line is fully contained into the plane. More...
 
double distance (const TPoint3D &point) const
 Distance to 3D point. More...
 
double distance (const TLine3D &line) const
 Distance to 3D line. More...
 
TVector3D getNormalVector () const
 Get plane's normal vector. More...
 
void unitarize ()
 Unitarize normal vector. More...
 
void getAsPose3D (mrpt::math::TPose3D &outPose) const
 
void getAsPose3DForcingOrigin (const TPoint3D &center, TPose3D &pose) const
 
TVector3D getUnitaryNormalVector () const
 Get normal vector. More...
 
 TPlane (const TPoint3D &p1, const TPoint3D &p2, const TPoint3D &p3)
 Defines a plane which contains these three points. More...
 
 TPlane (const TPoint3D &p1, const TVector3D &normal)
 Defines a plane given a point and a normal vector (must not be unit). More...
 
 TPlane (const TPoint3D &p1, const TLine3D &r2)
 Defines a plane which contains this point and this line. More...
 
 TPlane (const TLine3D &r1, const TLine3D &r2)
 Defines a plane which contains the two lines. More...
 
 TPlane ()=default
 Fast default constructor. More...
 
constexpr TPlane (double A, double B, double C, double D)
 Constructor from plane coefficients. More...
 
 TPlane (const double(&vec)[4])
 Constructor from an array of coefficients. More...
 

Public Attributes

std::array< double, 4 > coefs {{.0, .0, .0, .0}}
 Plane coefficients, stored as an array: $\left[A,B,C,D\right]$. More...
 

Constructor & Destructor Documentation

◆ TPlane() [1/7]

TPlane::TPlane ( const TPoint3D p1,
const TPoint3D p2,
const TPoint3D p3 
)

Defines a plane which contains these three points.

Exceptions
std::logic_errorif the points are linearly dependants.

Definition at line 95 of file TPlane.cpp.

References coefs, mrpt::math::getEpsilon(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ TPlane() [2/7]

TPlane::TPlane ( const TPoint3D p1,
const TVector3D normal 
)

Defines a plane given a point and a normal vector (must not be unit).

Exceptions
std::logic_errorif the normal vector is null

Definition at line 124 of file TPlane.cpp.

References ASSERT_ABOVE_, coefs, mrpt::math::getEpsilon(), mrpt::math::TPoint3D_< T >::norm(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ TPlane() [3/7]

TPlane::TPlane ( const TPoint3D p1,
const TLine3D r2 
)

Defines a plane which contains this point and this line.

Exceptions
std::logic_errorif the point is inside the line.

Definition at line 111 of file TPlane.cpp.

References coefs, mrpt::math::TLine3D::director, mrpt::math::getEpsilon(), mrpt::math::TLine3D::pBase, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ TPlane() [4/7]

TPlane::TPlane ( const TLine3D r1,
const TLine3D r2 
)

Defines a plane which contains the two lines.

Exceptions
std::logic_errorif the lines do not cross.

Definition at line 136 of file TPlane.cpp.

References coefs, mrpt::math::TLine3D::contains(), mrpt::math::crossProduct3D(), mrpt::math::TLine3D::director, evaluatePoint(), mrpt::math::getEpsilon(), mrpt::math::TLine3D::pBase, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ TPlane() [5/7]

mrpt::math::TPlane::TPlane ( )
default

Fast default constructor.

Initializes to garbage.

◆ TPlane() [6/7]

constexpr mrpt::math::TPlane::TPlane ( double  A,
double  B,
double  C,
double  D 
)
inline

Constructor from plane coefficients.

Definition at line 82 of file TPlane.h.

◆ TPlane() [7/7]

mrpt::math::TPlane::TPlane ( const double(&)  vec[4])
inline

Constructor from an array of coefficients.

Definition at line 88 of file TPlane.h.

References coefs.

Member Function Documentation

◆ contains() [1/3]

bool TPlane::contains ( const TPoint3D point) const

Check whether a point is contained into the plane.

Definition at line 28 of file TPlane.cpp.

References distance(), and mrpt::math::getEpsilon().

Referenced by contains(), getAsPose3DForcingOrigin(), and mrpt::math::intersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains() [2/3]

bool mrpt::math::TPlane::contains ( const TSegment3D segment) const
inline

Check whether a segment is fully contained into the plane.

Definition at line 36 of file TPlane.h.

References contains(), mrpt::math::TSegment3D::point1, and mrpt::math::TSegment3D::point2.

Here is the call graph for this function:

◆ contains() [3/3]

bool TPlane::contains ( const TLine3D line) const

Check whether a line is fully contained into the plane.

Definition at line 32 of file TPlane.cpp.

References contains(), mrpt::math::getAngle(), mrpt::math::getEpsilon(), and mrpt::math::TLine3D::pBase.

Here is the call graph for this function:

◆ distance() [1/2]

double TPlane::distance ( const TPoint3D point) const

Distance to 3D point.

Definition at line 38 of file TPlane.cpp.

References coefs, and evaluatePoint().

Referenced by contains(), distance(), and mrpt::math::distance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distance() [2/2]

double TPlane::distance ( const TLine3D line) const

Distance to 3D line.

Will be zero if the line is not parallel to the plane.

Definition at line 42 of file TPlane.cpp.

References distance(), mrpt::math::getAngle(), mrpt::math::getEpsilon(), and mrpt::math::TLine3D::pBase.

Here is the call graph for this function:

◆ evaluatePoint()

double TPlane::evaluatePoint ( const TPoint3D point) const

Evaluate a point in the plane's equation.

Definition at line 24 of file TPlane.cpp.

References coefs.

Referenced by mrpt::opengl::CPolyhedron::augment(), distance(), mrpt::math::intersect(), mrpt::math::project3D(), and TPlane().

Here is the caller graph for this function:

◆ getAsPose3D()

void TPlane::getAsPose3D ( mrpt::math::TPose3D outPose) const

Definition at line 73 of file TPlane.cpp.

References coefs, mrpt::math::TPose3D::fromHomogeneousMatrix(), mrpt::math::generateAxisBaseFromDirectionAndAxis(), mrpt::math::getEpsilon(), and getUnitaryNormalVector().

Referenced by mrpt::math::TPolygon3D::contains(), mrpt::math::getAngleBisector(), intersectInCommonPlane(), mrpt::math::project3D(), and mrpt::math::TPolygonWithPlane::TPolygonWithPlane().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAsPose3DForcingOrigin()

void TPlane::getAsPose3DForcingOrigin ( const TPoint3D center,
TPose3D pose 
) const

Definition at line 85 of file TPlane.cpp.

References contains(), mrpt::math::TPose3D::fromHomogeneousMatrix(), mrpt::math::generateAxisBaseFromDirectionAndAxis(), and getUnitaryNormalVector().

Referenced by mrpt::math::TPolygon3D::distance(), mrpt::math::intersect(), and mrpt::math::splitInConvexComponents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNormalVector()

TVector3D TPlane::getNormalVector ( ) const

Get plane's normal vector.

Definition at line 49 of file TPlane.cpp.

References coefs.

◆ getUnitaryNormalVector()

TVector3D TPlane::getUnitaryNormalVector ( ) const

Get normal vector.

Definition at line 56 of file TPlane.cpp.

References ASSERT_ABOVE_, coefs, and mrpt::math::getEpsilon().

Referenced by getAsPose3D(), and getAsPose3DForcingOrigin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unitarize()

void TPlane::unitarize ( )

Unitarize normal vector.

Definition at line 66 of file TPlane.cpp.

References coefs.

Referenced by mrpt::opengl::CPolyhedron::augment(), mrpt::math::getSegmentBisector(), and mrpt::math::project3D().

Here is the caller graph for this function:

Member Data Documentation

◆ coefs

std::array<double, 4> mrpt::math::TPlane::coefs {{.0, .0, .0, .0}}



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020