OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::Plane Class Reference

#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
 
Planeoperator= (const Plane &)=default
 
Planeoperator= (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< Point3dproject (const std::vector< Point3d > &points) const
 project a vector of points to this plane
 
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.
 
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
 

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

◆ Plane() [1/4]

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

construct with point and outward normal, throws openstudio::Exception if outwardNormal has 0 length.

◆ Plane() [2/4]

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.

◆ Plane() [3/4]

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

◆ Plane() [4/4]

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

Member Function Documentation

◆ a()

double openstudio::Plane::a ( ) const

coefficient a

◆ anyPointOnPlane()

Point3d openstudio::Plane::anyPointOnPlane ( ) const

◆ b()

double openstudio::Plane::b ( ) const

coefficient b

◆ c()

double openstudio::Plane::c ( ) const

coefficient c

◆ d()

double openstudio::Plane::d ( ) const

coefficient d

◆ equal()

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

◆ operator=() [1/2]

Plane & openstudio::Plane::operator= ( const Plane & )
default

◆ operator=() [2/2]

Plane & openstudio::Plane::operator= ( Plane && )
defaultnoexcept

◆ outwardNormal()

Vector3d openstudio::Plane::outwardNormal ( ) const

get the outward normal of this plane

◆ parallel()

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)

◆ pointOnPlane()

bool openstudio::Plane::pointOnPlane ( const Point3d & point,
double tol = 0.001 ) const

returns true if the point is on this plane

◆ project() [1/2]

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

project a point to this plane

◆ project() [2/2]

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

project a vector of points to this plane

◆ rayIntersection()

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

◆ reverseEqual()

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

◆ reversePlane()

Plane openstudio::Plane::reversePlane ( ) const

flip the plane so outward normal is opposite