MRPT
1.9.9
|
3D Plane, represented by its equation
#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... | |
void | getNormalVector (double(&vec)[3]) const |
Get plane's normal vector. More... | |
TVector3D | getNormalVector () const |
void | unitarize () |
Unitarize normal vector. More... | |
void | getAsPose3D (mrpt::math::TPose3D &outPose) const |
void | getAsPose3DForcingOrigin (const TPoint3D ¢er, TPose3D &pose) const |
void | getUnitaryNormalVector (double(&vec)[3]) 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: ![]() | |
Defines a plane which contains these three points.
std::logic_error | if the points are linearly dependants. |
Definition at line 987 of file TPoseOrPoint.cpp.
References coefs, mrpt::math::getEpsilon(), mrpt::math::TPoint3D_data::x, mrpt::math::TPoint3D_data::y, and mrpt::math::TPoint3D_data::z.
Defines a plane given a point and a normal vector (must not be unit).
std::logic_error | if the normal vector is null |
Definition at line 1016 of file TPoseOrPoint.cpp.
References ASSERT_ABOVE_, coefs, mrpt::math::getEpsilon(), mrpt::math::TPoint3D::norm(), mrpt::math::TPoint3D_data::x, mrpt::math::TPoint3D_data::y, and mrpt::math::TPoint3D_data::z.
Defines a plane which contains this point and this line.
std::logic_error | if the point is inside the line. |
Definition at line 1003 of file TPoseOrPoint.cpp.
References coefs, mrpt::math::TLine3D::director, mrpt::math::getEpsilon(), mrpt::math::TLine3D::pBase, mrpt::math::TPoint3D_data::x, mrpt::math::TPoint3D_data::y, and mrpt::math::TPoint3D_data::z.
Defines a plane which contains the two lines.
std::logic_error | if the lines do not cross. |
Definition at line 1028 of file TPoseOrPoint.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::x, mrpt::math::TPoint3D_data::y, and mrpt::math::TPoint3D_data::z.
|
default |
Fast default constructor.
Initializes to garbage.
|
inline |
|
inline |
bool mrpt::math::TPlane::contains | ( | const TPoint3D & | point | ) | const |
Check whether a point is contained into the plane.
Definition at line 914 of file TPoseOrPoint.cpp.
References distance(), and mrpt::math::getEpsilon().
Referenced by contains(), getAsPose3DForcingOrigin(), and mrpt::math::intersect().
|
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.
bool mrpt::math::TPlane::contains | ( | const TLine3D & | line | ) | const |
Check whether a line is fully contained into the plane.
Definition at line 918 of file TPoseOrPoint.cpp.
References contains(), mrpt::math::getAngle(), mrpt::math::getEpsilon(), and mrpt::math::TLine3D::pBase.
double mrpt::math::TPlane::distance | ( | const TPoint3D & | point | ) | const |
Distance to 3D point.
Definition at line 924 of file TPoseOrPoint.cpp.
References coefs, and evaluatePoint().
Referenced by contains(), distance(), and mrpt::math::distance().
double mrpt::math::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 928 of file TPoseOrPoint.cpp.
References distance(), mrpt::math::getAngle(), mrpt::math::getEpsilon(), and mrpt::math::TLine3D::pBase.
double mrpt::math::TPlane::evaluatePoint | ( | const TPoint3D & | point | ) | const |
Evaluate a point in the plane's equation.
Definition at line 910 of file TPoseOrPoint.cpp.
References coefs.
Referenced by mrpt::opengl::CPolyhedron::augment(), distance(), mrpt::math::intersect(), mrpt::math::project3D(), and TPlane().
void mrpt::math::TPlane::getAsPose3D | ( | mrpt::math::TPose3D & | outPose | ) | const |
Definition at line 961 of file TPoseOrPoint.cpp.
References coefs, mrpt::math::TPose3D::fromHomogeneousMatrix(), mrpt::math::generateAxisBaseFromDirectionAndAxis(), mrpt::math::getEpsilon(), and getUnitaryNormalVector().
Referenced by mrpt::math::TPolygon3D::contains(), intersectInCommonPlane(), mrpt::math::project3D(), and mrpt::math::TPolygonWithPlane::TPolygonWithPlane().
Definition at line 975 of file TPoseOrPoint.cpp.
References contains(), mrpt::math::TPose3D::fromHomogeneousMatrix(), mrpt::math::generateAxisBaseFromDirectionAndAxis(), and getUnitaryNormalVector().
Referenced by mrpt::math::TPolygon3D::distance().
void mrpt::math::TPlane::getNormalVector | ( | double(&) | vec[3] | ) | const |
Get plane's normal vector.
Definition at line 935 of file TPoseOrPoint.cpp.
References coefs.
Referenced by mrpt::opengl::CPolyhedron::setNormal().
TVector3D mrpt::math::TPlane::getNormalVector | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 939 of file TPoseOrPoint.cpp.
References coefs.
void mrpt::math::TPlane::getUnitaryNormalVector | ( | double(&) | vec[3] | ) | const |
Get normal vector.
Definition at line 946 of file TPoseOrPoint.cpp.
References ASSERT_ABOVE_, coefs, and mrpt::math::getEpsilon().
Referenced by getAsPose3D(), and getAsPose3DForcingOrigin().
void mrpt::math::TPlane::unitarize | ( | ) |
Unitarize normal vector.
Definition at line 954 of file TPoseOrPoint.cpp.
References coefs.
Referenced by mrpt::opengl::CPolyhedron::augment(), mrpt::math::getSegmentBisector(), and mrpt::math::project3D().
std::array<double, 4> mrpt::math::TPlane::coefs {{.0, .0, .0, .0}} |
Plane coefficients, stored as an array: .
Definition at line 26 of file TPlane.h.
Referenced by mrpt::opengl::CPolyhedron::augment(), createPlaneFromPoseAndAxis(), mrpt::math::createPlaneFromPoseAndNormal(), distance(), mrpt::math::distance(), evaluatePoint(), mrpt::math::getAngle(), getAsPose3D(), mrpt::opengl::CPolyhedron::getDual(), getNormalVector(), mrpt::math::getRegressionPlane(), mrpt::math::getSegmentBisector(), getUnitaryNormalVector(), mrpt::math::intersect(), mrpt::math::project3D(), mrpt::math::ransac3Dplane_distance(), mrpt::math::ransac3Dplane_fit(), TPlane(), and unitarize().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019 |