![]() |
ImFusion C++ SDK 4.4.0
|
#include <ImFusion/Core/Geometry/Plane.h>
Class representing an oriented plane in 3D space defined by a base point and a normal direction. More...
Class representing an oriented plane in 3D space defined by a base point and a normal direction.
Unless stated otherwise, all operations that involve comparisons use the same tolerance epsilon as vec3::isApprox (which is 1e-12).
Public Member Functions | |
| Plane (const vec3 &point, const vec3 &normal) | |
| Construct plane from point and normal, the latter will be normalized. | |
| Plane (const Rectangle &rect) | |
| Construct plane by extending a rectangle. User is responsible for the rectangle being valid. | |
| vec4 | hesseNormalForm () const |
| Returns [normal, d] with d >= 0 such that for any point p its distance to the plane is given by abs(p.dot(normal) - d). | |
| vec4 | computerVisionNormalForm () const |
| Returns cvnf = [normal, d] such that for any point p its distance to the plane is given by abs(p.dot(normal) + d), in terser notation: abs(p.homogeneous().dot(cvnf)). | |
| const vec3 & | point () const |
| const vec3 & | normal () const |
| bool | isApprox (const Plane &other) |
| Comparison using the same epsilon as Eigen::isApprox. | |
| bool | isEquivalent (const Plane &other, bool considerOrientation=false) |
| Returns if both Plane objects describe the same geometrical objects. | |
| vec3 | closestPoint (const vec3 &p) const |
| Returns the point on the plane closest to p. | |
| double | distanceToPoint (const vec3 &p) const |
| Returns the L2 distance between p and the closest point on the plane. | |
| double | signedDistanceToPoint (const vec3 &p) const |
| Returns the dot product of the vector from the plane towards p and the plane normal. | |
| bool | includesPoint (const vec3 &p) const |
| Returns if p sits on the plane. | |
Static Public Member Functions | |
| static Plane | fromComputerVisionNormalForm (const vec4 &cvnf) |
| Construct plane from normal form, see computerVisionNormalForm() for details. | |
| bool | operator== (const Plane &) const |
| Exact comparisons of Plane instances based on the point() and normal(). | |
| bool | operator!= (const Plane &) const |
| ImFusion::Geometry::Plane::Plane | ( | const vec3 & | point, |
| const vec3 & | normal ) |
Construct plane from point and normal, the latter will be normalized.
Passing something that cannot be normalized will invalidate the plane (does not intersect, distance to anything is NAN).
| vec4 ImFusion::Geometry::Plane::hesseNormalForm | ( | ) | const |
Returns [normal, d] with d >= 0 such that for any point p its distance to the plane is given by abs(p.dot(normal) - d).
| vec4 ImFusion::Geometry::Plane::computerVisionNormalForm | ( | ) | const |
Returns cvnf = [normal, d] such that for any point p its distance to the plane is given by abs(p.dot(normal) + d), in terser notation: abs(p.homogeneous().dot(cvnf)).
| bool ImFusion::Geometry::Plane::operator== | ( | const Plane & | ) | const |
Exact comparisons of Plane instances based on the point() and normal().
If you instead want to check if the represented geometric structures are the same, use isEquivalent().
| bool ImFusion::Geometry::Plane::isEquivalent | ( | const Plane & | other, |
| bool | considerOrientation = false ) |
Returns if both Plane objects describe the same geometrical objects.
Note that unlike all other comparisons provided here this allows anti-parallel normals and using different points to define the same position.