#include <Plane.hpp>
Public Member Functions | |
double | a () const |
coefficient a | |
Point3d | anyPointOnPlane () const |
double | b () const |
coefficient b | |
double | c () const |
coefficient c | |
double | d () const |
coefficient d | |
bool | equal (const Plane &other, double tol=0.001) const |
is this plane equal to the other plane true if dot product of outward normals is >= (1-tol) and abs(d1-d2) <= tol | |
Plane & | operator= (const Plane &)=default |
Plane & | operator= (Plane &&) noexcept=default |
Vector3d | outwardNormal () const |
get the outward normal of this plane | |
bool | parallel (const Plane &other, double tol=0.001) const |
is this plane parallel to the other plane true if absolute value of dot product of outward normals is >= (1-tol) | |
Plane (const Plane &other)=default | |
Plane (const Point3d &point, const Vector3d &outwardNormal) | |
construct with point and outward normal, throws openstudio::Exception if outwardNormal has 0 length. | |
Plane (const std::vector< Point3d > &points) | |
construct with points, will fit least squares plane. | |
Plane (Plane &&other) noexcept=default | |
bool | pointOnPlane (const Point3d &point, double tol=0.001) const |
returns true if the point is on this plane | |
Point3d | project (const Point3d &point) const |
project a point to this plane | |
std::vector< Point3d > | project (const std::vector< Point3d > &points) const |
project a vector of points to this plane | |
boost::optional< Point3d > | rayIntersection (const Point3d &rayOrigin, const Vector3d &rayDirection, bool enforceDirectionOfPlane=false) const |
Project a directed ray towards a plane and returns the intersection point if any. | |
bool | reverseEqual (const Plane &other, double tol=0.001) const |
is this plane reverse equal to the other plane true if dot product of outward normals is <= (-1+tol) and abs(d1+d2) <= tol | |
Plane | reversePlane () const |
flip the plane so outward normal is opposite | |
Plane defines an infinite plane in 3D space.
The equation of a plane is a*x + b*y + c*z + d = 0, any point that satisfies this equation is on the plane.
construct with point and outward normal, throws openstudio::Exception if outwardNormal has 0 length.
openstudio::Plane::Plane | ( | const std::vector< Point3d > & | points | ) |
construct with points, will fit least squares plane.
attempts to align outward normal with that of the points (according to right hand rule). throws openstudio::Exception if cannot compute plane for these points.
|
default |
|
defaultnoexcept |
double openstudio::Plane::a | ( | ) | const |
coefficient a
Point3d openstudio::Plane::anyPointOnPlane | ( | ) | const |
double openstudio::Plane::b | ( | ) | const |
coefficient b
double openstudio::Plane::c | ( | ) | const |
coefficient c
double openstudio::Plane::d | ( | ) | const |
coefficient d
bool openstudio::Plane::equal | ( | const Plane & | other, |
double | tol = 0.001 ) const |
is this plane equal to the other plane true if dot product of outward normals is >= (1-tol) and abs(d1-d2) <= tol
Vector3d openstudio::Plane::outwardNormal | ( | ) | const |
get the outward normal of this plane
bool openstudio::Plane::parallel | ( | const Plane & | other, |
double | tol = 0.001 ) const |
is this plane parallel to the other plane true if absolute value of dot product of outward normals is >= (1-tol)
bool openstudio::Plane::pointOnPlane | ( | const Point3d & | point, |
double | tol = 0.001 ) const |
returns true if the point is on this plane
project a vector of points to this plane
boost::optional< Point3d > openstudio::Plane::rayIntersection | ( | const Point3d & | rayOrigin, |
const Vector3d & | rayDirection, | ||
bool | enforceDirectionOfPlane = false ) const |
Project a directed ray towards a plane and returns the intersection point if any.
The RayDirection should be shooting TOWARDS the plane If enforceDirectionOfPlane is true, the ray direction and the plane outward normal must be facing each other
bool openstudio::Plane::reverseEqual | ( | const Plane & | other, |
double | tol = 0.001 ) const |
is this plane reverse equal to the other plane true if dot product of outward normals is <= (-1+tol) and abs(d1+d2) <= tol
Plane openstudio::Plane::reversePlane | ( | ) | const |
flip the plane so outward normal is opposite