Geometric class that creates a 3D plane and can return the intersection point between a line and the plane. More...
#include <plane.H>

Classes | |
| class | ray |
| A reference point and direction. More... | |
Public Types | |
| enum | side { FRONT = 1 , BACK = -1 , NORMAL = FRONT , FLIP = BACK } |
| Side of the plane. More... | |
Public Member Functions | |
| plane () | |
| Construct zero-initialised. | |
| plane (const vector &normalVector) | |
| Construct from normal vector through the origin. | |
| plane (const point &originPoint, const vector &normalVector, const bool doNormalise=true) | |
| Construct from normal vector and point in plane. | |
| plane (const point &point1, const point &point2, const point &point3) | |
| Construct from three points in plane. | |
| plane (const UList< scalar > &coeffs) | |
| Construct from coefficients for the plane equation: ax + by + cz + d = 0. | |
| plane (const FixedList< scalar, 4 > &coeffs) | |
| Construct from coefficients for the plane equation: ax + by + cz + d = 0. | |
| plane (const dictionary &dict) | |
| Construct from dictionary. | |
| plane (Istream &is) | |
| Construct from Istream. Assumes (normal) (origin) input. | |
| const vector & | normal () const noexcept |
| The plane unit normal. | |
| const point & | origin () const noexcept |
| The plane base point. | |
| point & | origin () noexcept |
| The plane base point, for modification. | |
| void | flip () |
| Flip the plane by reversing the normal. | |
| FixedList< scalar, 4 > | planeCoeffs () const |
| Return coefficients for the plane equation: ax + by + cz + d = 0. | |
| point | nearestPoint (const point &p) const |
| Return nearest point in the plane for the given point. | |
| scalar | distance (const point &p) const |
| Return distance (magnitude) from the given point to the plane. | |
| scalar | signedDistance (const point &p) const |
| Return distance from the given point to the plane. | |
| scalar | normalIntersect (const point &pnt0, const vector &dir) const |
| Return cut coefficient for plane and line defined by origin and direction. | |
| scalar | normalIntersect (const ray &r) const |
| Return cut coefficient for plane and ray. | |
| template<class PointType, class PointRef> | |
| scalar | lineIntersect (const line< PointType, PointRef > &l) const |
| Return the cutting point between the plane and a line passing through the supplied points. | |
| ray | planeIntersect (const plane &plane2) const |
| Return the cutting line between this plane and another. | |
| point | planePlaneIntersect (const plane &plane2, const plane &plane3) const |
| Return the cutting point between this plane and two other planes. | |
| point | somePointInPlane (const scalar dist=1e-3) const |
| Return a point somewhere on the plane, a distance from the base. | |
| side | whichSide (const point &p) const |
| Return the side of the plane that the point is on. | |
| int | sign (const point &p, const scalar tol=SMALL) const |
| The sign for the side of the plane that the point is on. | |
| point | mirror (const point &p) const |
| Mirror the supplied point in the plane. Return the mirrored point. | |
| void | writeDict (Ostream &os) const |
| Write to dictionary. | |
| const point & | refPoint () const noexcept |
| The plane base point (same as origin). | |
| side | sideOfPlane (const point &p) const |
| Same as whichSide(). | |
Geometric class that creates a 3D plane and can return the intersection point between a line and the plane.
Construction from a dictionary is driven by the planeType. If planeType is missing, pointAndNormal is used and the pointAndNormalDict becomes optional.
For planeType as pointAndNormal :
pointAndNormalDict
{
point <point>; // basePoint (1612 and earlier)
normal <vector>; // normalVector (1612 and earlier)
}
For planeType as embeddedPoints :
embeddedPointsDict
{
point1 <point>;
point2 <point>;
point3 <point>;
}
For planeType with planeEquation coefficients 
planeEquationDict
{
a <scalar>;
b <scalar>;
c <scalar>;
d <scalar>;
}
| enum side |
|
inline |
Construct zero-initialised.
Definition at line 23 of file planeI.H.
References Foam::Zero.
Referenced by cuttingPlane::checkOverlap(), cuttingPlane::cuttingPlane(), cuttingPlane::cuttingPlane(), cuttingPlane::cuttingPlane(), cuttingPlane::cuttingPlane(), cuttingPlane::operator=(), cuttingPlane::performCut(), cuttingPlane::planeDesc(), cuttingPlane::planeDesc(), planeIntersect(), planePlaneIntersect(), searchableDisk::searchableDisk(), searchablePlane::searchablePlane(), and searchablePlane::searchablePlane().

|
explicit |
Construct from normal vector through the origin.
The vector is normalised to a unit vector on input.
Definition at line 115 of file plane.C.
References FUNCTION_NAME, and Foam::Zero.
Construct from normal vector and point in plane.
By default, the vector is normalised to a unit vector on input.
Definition at line 124 of file plane.C.
References FUNCTION_NAME.
Construct from three points in plane.
Definition at line 164 of file plane.C.
References b, and FUNCTION_NAME.
|
explicit |
Construct from coefficients for the plane equation: ax + by + cz + d = 0.
Definition at line 138 of file plane.C.
References FUNCTION_NAME.
|
explicit |
Construct from coefficients for the plane equation: ax + by + cz + d = 0.
Definition at line 151 of file plane.C.
References FUNCTION_NAME.
|
explicit |
Construct from dictionary.
Definition at line 170 of file plane.C.
References Foam::abort(), dict, Foam::FatalIOError, FatalIOErrorInFunction, dictionary::get(), dictionary::getCompat(), if(), Foam::nl, and Foam::Zero.

|
explicit |
Construct from Istream. Assumes (normal) (origin) input.
Definition at line 231 of file plane.C.
References FUNCTION_NAME.
|
inlinenoexcept |
The plane unit normal.
Definition at line 32 of file planeI.H.
References Foam::noexcept.
Referenced by geomCellLooper::cut(), searchableDisk::getNormal(), searchablePlane::getNormal(), mirror(), Foam::operator<<(), Foam::operator==(), planeIntersect(), sampledPlane::print(), sampledPlane::sampledPlane(), searchableDisk::searchableDisk(), searchablePlane::searchablePlane(), and searchablePlane::TypeName().

|
inlinenoexcept |
The plane base point.
Definition at line 38 of file planeI.H.
References Foam::noexcept.
Referenced by searchableDisk::boundingSpheres(), searchablePlane::boundingSpheres(), searchableDisk::coordinates(), searchablePlane::coordinates(), Foam::operator<(), Foam::operator<<(), Foam::operator==(), planeIntersect(), sampledPlane::print(), sampledPlane::sampledPlane(), and searchableDisk::searchableDisk().

|
inlinenoexcept |
The plane base point, for modification.
Definition at line 44 of file planeI.H.
References Foam::noexcept.
|
inline |
| Foam::FixedList< Foam::scalar, 4 > planeCoeffs | ( | ) | const |
Return coefficients for the plane equation: ax + by + cz + d = 0.
Definition at line 242 of file plane.C.
References Foam::mag().
Referenced by planePlaneIntersect(), and somePointInPlane().


|
inline |
Return nearest point in the plane for the given point.
Definition at line 56 of file planeI.H.
References p.
Referenced by searchablePlane::findNearest(), and mirror().

|
inline |
Return distance (magnitude) from the given point to the plane.
Definition at line 62 of file planeI.H.
References Foam::mag(), p, and signedDistance().
Referenced by geomCellLooper::cut().


|
inline |
Return distance from the given point to the plane.
Definition at line 68 of file planeI.H.
References p.
Referenced by distance(), sign(), and whichSide().

Return cut coefficient for plane and line defined by origin and direction.
Definition at line 292 of file plane.C.
References Foam::stabilise().
Referenced by lineIntersect(), and normalIntersect().


|
inline |
Return cut coefficient for plane and ray.
Definition at line 307 of file plane.H.
References normalIntersect().

|
inline |
Return the cutting point between the plane and a line passing through the supplied points.
Definition at line 317 of file plane.H.
References normalIntersect(), line< Point, PointRef >::start(), and line< Point, PointRef >::vec().
Referenced by slidingInterface::modifyMotionPoints(), cuttingPlane::performCut(), and surfaceFeatures::subsetPlane().


| Foam::plane::ray planeIntersect | ( | const plane & | plane2 | ) | const |
Return the cutting line between this plane and another.
Returned as direction vector and point line goes through.
Definition at line 304 of file plane.C.
References Foam::mag(), normal(), origin(), plane(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by searchableSurfacesQueries::findNearest().


| Foam::point planePlaneIntersect | ( | const plane & | plane2, |
| const plane & | plane3 ) const |
Return the cutting point between this plane and two other planes.
Definition at line 372 of file plane.C.
References b, Foam::inv(), plane(), and planeCoeffs().

| Foam::point somePointInPlane | ( | const scalar | dist = 1e-3 | ) | const |
Return a point somewhere on the plane, a distance from the base.
Definition at line 395 of file plane.C.
References Foam::mag(), p, planeCoeffs(), and VectorSpace< Form, Cmpt, Ncmpts >::uniform().

|
inline |
Return the side of the plane that the point is on.
If the point is on the plane, then returns FRONT.
Definition at line 74 of file planeI.H.
References BACK, FRONT, p, and signedDistance().
Referenced by sideOfPlane().


|
inline |
The sign for the side of the plane that the point is on.
Uses the supplied tolerance for rounding around zero.
Definition at line 82 of file planeI.H.
References p, and signedDistance().

| Foam::point mirror | ( | const point & | p | ) | const |
Mirror the supplied point in the plane. Return the mirrored point.
Definition at line 423 of file plane.C.
References Foam::distance(), nearestPoint(), normal(), and p.

| void writeDict | ( | Ostream & | os | ) | const |
|
inlinenoexcept |
The plane base point (same as origin).
Definition at line 381 of file plane.H.
References Foam::noexcept.
Same as whichSide().
Definition at line 386 of file plane.H.
References p, and whichSide().
