moab
|
struct to store a plane More...
#include <BSPTree.hpp>
Public Member Functions | |
Plane () | |
Plane (const double n[3], double d) | |
Plane (double a, double b, double c, double d) | |
Plane (Axis normal, double point_on_axis) | |
double | signed_distance (const double point[3]) const |
bool | below (const double point[3]) const |
bool | above (const double point[3]) const |
double | distance (const double point[3]) const |
void | flip () |
void | set (const double normal[3], const double point[3]) |
void | set (const double pt1[3], const double pt2[3], const double pt3[3]) |
void | set (double i, double j, double k, double cff) |
void | set (Axis normal, double point_on_axis) |
Public Attributes | |
double | norm [3] |
Unit normal of plane. | |
double | coeff |
norm[0]*x + norm[1]*y + norm[2]*z + coeff = 0 |
struct to store a plane
If plane is defined as Ax+By+Cz+D=0, then norm={A,B,C} and coeff=-D.
Definition at line 75 of file BSPTree.hpp.
moab::BSPTree::Plane::Plane | ( | ) | [inline] |
Definition at line 76 of file BSPTree.hpp.
{}
moab::BSPTree::Plane::Plane | ( | const double | n[3], |
double | d | ||
) | [inline] |
moab::BSPTree::Plane::Plane | ( | double | a, |
double | b, | ||
double | c, | ||
double | d | ||
) | [inline] |
moab::BSPTree::Plane::Plane | ( | Axis | normal, |
double | point_on_axis | ||
) | [inline] |
bool moab::BSPTree::Plane::above | ( | const double | point[3] | ) | const [inline] |
return true if point is above the plane
Definition at line 102 of file BSPTree.hpp.
{ return signed_distance(point) >= 0.0; }
bool moab::BSPTree::Plane::below | ( | const double | point[3] | ) | const [inline] |
return true if point is below the plane
Definition at line 98 of file BSPTree.hpp.
{ return signed_distance(point) <= 0.0; }
double moab::BSPTree::Plane::distance | ( | const double | point[3] | ) | const [inline] |
Definition at line 105 of file BSPTree.hpp.
{ return fabs( signed_distance(point) ); }
void moab::BSPTree::Plane::flip | ( | ) | [inline] |
void moab::BSPTree::Plane::set | ( | const double | normal[3], |
const double | point[3] | ||
) | [inline] |
Definition at line 112 of file BSPTree.hpp.
void moab::BSPTree::Plane::set | ( | const double | pt1[3], |
const double | pt2[3], | ||
const double | pt3[3] | ||
) |
Definition at line 92 of file BSPTree.cpp.
{ const double v1[] = { pt2[0] - pt1[0], pt2[1] - pt1[1], pt2[2] - pt1[2] }; const double v2[] = { pt3[0] - pt1[0], pt3[1] - pt1[1], pt3[2] - pt1[2] }; const double nrm[] = { v1[1]*v2[2] - v1[2]*v2[1], v1[2]*v2[0] - v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0] }; set( nrm, pt1 ); }
void moab::BSPTree::Plane::set | ( | double | i, |
double | j, | ||
double | k, | ||
double | cff | ||
) | [inline] |
Definition at line 120 of file BSPTree.hpp.
{ *this = Plane( i, j, k, cff ); }
void moab::BSPTree::Plane::set | ( | Axis | normal, |
double | point_on_axis | ||
) | [inline] |
double moab::BSPTree::Plane::signed_distance | ( | const double | point[3] | ) | const [inline] |
double moab::BSPTree::Plane::coeff |
norm[0]*x + norm[1]*y + norm[2]*z + coeff = 0
Definition at line 87 of file BSPTree.hpp.
double moab::BSPTree::Plane::norm[3] |
Unit normal of plane.
Definition at line 86 of file BSPTree.hpp.