OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
openstudio::Plane Class Reference

#include <Plane.hpp>

Public Member Functions

double a () const
 coefficient a More...
 
Point3d anyPointOnPlane () const
 
double b () const
 coefficient b More...
 
double c () const
 coefficient c More...
 
double d () const
 coefficient d More...
 
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 More...
 
Planeoperator= (const Plane &)=default
 
Planeoperator= (Plane &&) noexcept=default
 
Vector3d outwardNormal () const
 get the outward normal of this plane More...
 
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) More...
 
 Plane (const Point3d &point, const Vector3d &outwardNormal)
 construct with point and outward normal, throws openstudio::Exception if outwardNormal has 0 length. More...
 
 Plane (const std::vector< Point3d > &points)
 construct with points, will fit least squares plane. More...
 
 Plane (const Plane &other)=default
 
 Plane (Plane &&other) noexcept=default
 
bool pointOnPlane (const Point3d &point, double tol=0.001) const
 returns true if the point is on this plane More...
 
Point3d project (const Point3d &point) const
 project a point to this plane More...
 
std::vector< Point3dproject (const std::vector< Point3d > &points) const
 project a vector of points to this plane More...
 
boost::optional< Point3drayIntersection (const Point3d &rayOrigin, const Vector3d &rayDirection, bool enforceDirectionOfPlane=false) const
 Project a directed ray towards a plane and returns the intersection point if any. More...
 
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 More...
 
Plane reversePlane () const
 flip the plane so outward normal is opposite More...
 

Detailed Description

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.

Constructor & Destructor Documentation

openstudio::Plane::Plane ( const Point3d point,
const Vector3d outwardNormal 
)

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.

openstudio::Plane::Plane ( const Plane other)
default
openstudio::Plane::Plane ( Plane &&  other)
defaultnoexcept

Member Function Documentation

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

Plane& openstudio::Plane::operator= ( const Plane )
default
Plane& openstudio::Plane::operator= ( Plane &&  )
defaultnoexcept
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

Point3d openstudio::Plane::project ( const Point3d point) const

project a point to this plane

std::vector<Point3d> openstudio::Plane::project ( const std::vector< Point3d > &  points) const

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