Geometric class that creates a 3D plane and can return the intersection point between a line and the plane. More...
Classes | |
class | ray |
A reference point and direction. More... | |
Public Types | |
enum | side { FRONT = 1, BACK = -1, NORMAL = 1, FLIP = -1 } |
Side of the plane. More... | |
Public Member Functions | |
plane () | |
Construct zero-initialised. More... | |
plane (const vector &normalVector) | |
Construct from normal vector through the origin. More... | |
plane (const point &originPoint, const vector &normalVector, const bool doNormalise=true) | |
Construct from normal vector and point in plane. More... | |
plane (const point &point1, const point &point2, const point &point3) | |
Construct from three points in plane. More... | |
plane (const scalarList &coeffs) | |
plane (const FixedList< scalar, 4 > &coeffs) | |
plane (const dictionary &dict) | |
Construct from dictionary. More... | |
plane (Istream &is) | |
Construct from Istream. Assumes (normal) (origin) input. More... | |
const vector & | normal () const |
The plane unit normal. More... | |
const point & | origin () const |
The plane base point. More... | |
point & | origin () |
The plane base point, for modification. More... | |
const point & | refPoint () const |
The plane base point (same as origin) More... | |
void | flip () |
Flip the plane by reversing the normal. More... | |
FixedList< scalar, 4 > | planeCoeffs () const |
point | nearestPoint (const point &p) const |
Return nearest point in the plane for the given point. More... | |
scalar | distance (const point &p) const |
Return distance (magnitude) from the given point to the plane. More... | |
scalar | signedDistance (const point &p) const |
Return distance from the given point to the plane. More... | |
scalar | normalIntersect (const point &pnt0, const vector &dir) const |
scalar | normalIntersect (const ray &r) const |
Return cut coefficient for plane and ray. More... | |
template<class Point , class PointRef > | |
scalar | lineIntersect (const line< Point, PointRef > &l) const |
Return the cutting point between the plane and. More... | |
ray | planeIntersect (const plane &plane2) const |
Return the cutting line between this plane and another. More... | |
point | planePlaneIntersect (const plane &plane2, const plane &plane3) const |
Return the cutting point between this plane and two other planes. More... | |
point | somePointInPlane (const scalar dist=1e-3) const |
Return a point somewhere on the plane, a distance from the base. More... | |
side | sideOfPlane (const point &p) const |
Return the side of the plane that the point is on. More... | |
int | sign (const point &p, const scalar tol=SMALL) const |
The sign for the side of the plane that the point is on. More... | |
point | mirror (const point &p) const |
Mirror the supplied point in the plane. Return the mirrored point. More... | |
void | writeDict (Ostream &os) const |
Write to dictionary. More... | |
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
For planeType
as pointAndNormal
:
pointAndNormalDict { point <point>; // or basePoint normal <vector>; // or normalVector }
For planeType
as embeddedPoints
:
embeddedPointsDict { point1 <point>; point2 <point>; point3 <point>; }
For planeType
with planeEquation
coefficients \( ax + by + cz + d = 0 \) :
planeEquationDict { a <scalar>; b <scalar>; c <scalar>; d <scalar>; }
enum side |
Construct from normal vector through the origin.
The vector is normalised to a unit vector on input.
Definition at line 121 of file plane.C.
References FUNCTION_NAME.
Construct from normal vector and point in plane.
By default, the vector is normalised to a unit vector on input.
Definition at line 131 of file plane.C.
References FUNCTION_NAME.
Construct from three points in plane.
Definition at line 170 of file plane.C.
References Foam::constant::physicoChemical::b, Foam::constant::universal::c, and FUNCTION_NAME.
|
explicit |
Construct from coefficients for the plane equation: ax + by + cz + d = 0
Definition at line 144 of file plane.C.
References FUNCTION_NAME.
Construct from coefficients for the plane equation: ax + by + cz + d = 0
Definition at line 157 of file plane.C.
References FUNCTION_NAME.
|
explicit |
Construct from dictionary.
Definition at line 176 of file plane.C.
References Foam::abort(), dict, Foam::FatalIOError, FatalIOErrorInFunction, dictionary::get(), dictionary::getCompat(), and Foam::nl.
Construct from Istream. Assumes (normal) (origin) input.
Definition at line 228 of file plane.C.
References FUNCTION_NAME.
|
inline |
The plane unit normal.
Definition at line 39 of file planeI.H.
Referenced by geomCellLooper::cut(), Foam::operator<<(), Foam::operator==(), plane::planeIntersect(), sampledPlane::print(), and sampledPlane::sampledPlane().
|
inline |
The plane base point.
Definition at line 45 of file planeI.H.
Referenced by Foam::operator<(), Foam::operator<<(), Foam::operator==(), plane::planeIntersect(), sampledPlane::print(), and sampledPlane::sampledPlane().
|
inline |
|
inline |
|
inline |
Foam::FixedList< Foam::scalar, 4 > planeCoeffs | ( | ) | const |
Return coefficients for the plane equation: ax + by + cz + d = 0
Definition at line 239 of file plane.C.
References Foam::mag().
Referenced by plane::planePlaneIntersect().
|
inline |
|
inline |
Return distance (magnitude) from the given point to the plane.
Definition at line 75 of file planeI.H.
References Foam::mag(), and p.
Referenced by geomCellLooper::cut().
|
inline |
Return cut coefficient for plane and line defined by origin and direction
Definition at line 290 of file plane.C.
References Foam::stabilise().
Referenced by plane::lineIntersect(), and plane::normalIntersect().
|
inline |
Return cut coefficient for plane and ray.
Definition at line 249 of file plane.H.
References plane::ray::dir(), plane::normalIntersect(), and plane::ray::refPoint().
Return the cutting point between the plane and.
a line passing through the supplied points
Definition at line 257 of file plane.H.
References plane::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 301 of file plane.C.
References Foam::mag(), plane::normal(), plane::origin(), 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 370 of file plane.C.
References Foam::constant::physicoChemical::b, Foam::inv(), and plane::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 392 of file plane.C.
References Foam::mag(), p, and VectorSpace< Vector< Cmpt >, Cmpt, 3 >::uniform().
|
inline |
Return the side of the plane that the point is on.
If the point is on the plane, then returns NORMAL.
Definition at line 87 of file planeI.H.
References p.
Referenced by boundBox::intersects().
|
inline |
Foam::point mirror | ( | const point & | p | ) | const |
Mirror the supplied point in the plane. Return the mirrored point.
Definition at line 420 of file plane.C.
References Foam::distance(), and p.
void writeDict | ( | Ostream & | os | ) | const |
Write to dictionary.
Definition at line 435 of file plane.C.
References Ostream::beginBlock(), Ostream::endBlock(), and Ostream::writeEntry().