Classes | Public Types | Public Member Functions | List of all members
plane Class Reference

Geometric class that creates a 3D plane and can return the intersection point between a line and the plane. More...

Inheritance diagram for plane:
Inheritance graph
[legend]

Classes

class  ray
 

Public Types

enum  side { FRONT = 1, BACK = -1, NORMAL = 1, FLIP = -1 }
 

Public Member Functions

 plane ()
 
 plane (const vector &normalVector)
 
 plane (const point &originPoint, const vector &normalVector, const bool doNormalise=true)
 
 plane (const point &point1, const point &point2, const point &point3)
 
 plane (const scalarList &coeffs)
 
 plane (const FixedList< scalar, 4 > &coeffs)
 
 plane (const dictionary &dict)
 
 plane (Istream &is)
 
const vectornormal () const
 
const pointorigin () const
 
pointorigin ()
 
const pointrefPoint () const
 
void flip ()
 
FixedList< scalar, 4 > planeCoeffs () const
 
point nearestPoint (const point &p) const
 
scalar distance (const point &p) const
 
scalar signedDistance (const point &p) const
 
scalar normalIntersect (const point &pnt0, const vector &dir) const
 
scalar normalIntersect (const ray &r) const
 
template<class Point , class PointRef >
scalar lineIntersect (const line< Point, PointRef > &l) const
 
ray planeIntersect (const plane &plane2) const
 
point planePlaneIntersect (const plane &plane2, const plane &plane3) const
 
point somePointInPlane (const scalar dist=1e-3) const
 
side sideOfPlane (const point &p) const
 
int sign (const point &p, const scalar tol=SMALL) const
 
point mirror (const point &p) const
 
void writeDict (Ostream &os) const
 

Detailed Description

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>;
}
Source files

Definition at line 85 of file plane.H.

Member Enumeration Documentation

◆ side

enum side
Enumerator
FRONT 

The front (positive normal) side of the plane.

BACK 

The back (negative normal) side of the plane.

NORMAL 

Same as FRONT.

FLIP 

Same as BACK.

Definition at line 90 of file plane.H.

Constructor & Destructor Documentation

◆ plane() [1/8]

plane ( )
inline

Definition at line 23 of file planeI.H.

◆ plane() [2/8]

plane ( const vector normalVector)
explicit

Definition at line 114 of file plane.C.

References FUNCTION_NAME.

◆ plane() [3/8]

plane ( const point originPoint,
const vector normalVector,
const bool  doNormalise = true 
)

Definition at line 124 of file plane.C.

References FUNCTION_NAME.

◆ plane() [4/8]

plane ( const point point1,
const point point2,
const point point3 
)

◆ plane() [5/8]

plane ( const scalarList coeffs)
explicit

Definition at line 137 of file plane.C.

References FUNCTION_NAME.

◆ plane() [6/8]

plane ( const FixedList< scalar, 4 > &  coeffs)
explicit

Definition at line 150 of file plane.C.

References FUNCTION_NAME.

◆ plane() [7/8]

plane ( const dictionary dict)
explicit

Definition at line 169 of file plane.C.

References Foam::abort(), dict, Foam::FatalIOError, FatalIOErrorInFunction, dictionary::get(), dictionary::getCompat(), and Foam::nl.

Here is the call graph for this function:

◆ plane() [8/8]

plane ( Istream is)
explicit

Definition at line 221 of file plane.C.

References FUNCTION_NAME.

Member Function Documentation

◆ normal()

const Foam::vector & normal ( ) const
inline

Definition at line 32 of file planeI.H.

Referenced by geomCellLooper::cut(), Foam::operator<<(), Foam::operator==(), plane::planeIntersect(), sampledPlane::print(), and sampledPlane::sampledPlane().

Here is the caller graph for this function:

◆ origin() [1/2]

Foam::point & origin ( ) const
inline

◆ origin() [2/2]

point& origin ( )
inline

◆ refPoint()

const Foam::point & refPoint ( ) const
inline

Definition at line 50 of file planeI.H.

◆ flip()

void flip ( )
inline

Definition at line 56 of file planeI.H.

◆ planeCoeffs()

Foam::FixedList< Foam::scalar, 4 > planeCoeffs ( ) const

Definition at line 232 of file plane.C.

References Foam::mag().

Referenced by plane::planePlaneIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestPoint()

Foam::point nearestPoint ( const point p) const
inline

Definition at line 62 of file planeI.H.

References p.

◆ distance()

Foam::scalar distance ( const point p) const
inline

Definition at line 68 of file planeI.H.

References Foam::mag(), and p.

Referenced by geomCellLooper::cut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signedDistance()

Foam::scalar signedDistance ( const point p) const
inline

Definition at line 74 of file planeI.H.

References p.

◆ normalIntersect() [1/2]

Foam::scalar normalIntersect ( const point pnt0,
const vector dir 
) const

Definition at line 283 of file plane.C.

References Foam::stabilise().

Referenced by plane::lineIntersect(), and plane::normalIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalIntersect() [2/2]

scalar normalIntersect ( const ray r) const
inline

Definition at line 245 of file plane.H.

References plane::ray::dir(), plane::normalIntersect(), and plane::ray::refPoint().

Here is the call graph for this function:

◆ lineIntersect()

scalar lineIntersect ( const line< Point, PointRef > &  l) const
inline

Definition at line 253 of file plane.H.

References plane::normalIntersect(), line::start(), and line::vec().

Referenced by slidingInterface::modifyMotionPoints(), cuttingPlane::performCut(), and surfaceFeatures::subsetPlane().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ planeIntersect()

Foam::plane::ray planeIntersect ( const plane plane2) const

Definition at line 294 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ planePlaneIntersect()

Foam::point planePlaneIntersect ( const plane plane2,
const plane plane3 
) const

Definition at line 363 of file plane.C.

References Foam::constant::physicoChemical::b, Foam::inv(), and plane::planeCoeffs().

Here is the call graph for this function:

◆ somePointInPlane()

Foam::point somePointInPlane ( const scalar  dist = 1e-3) const

Definition at line 385 of file plane.C.

References Foam::mag(), p, and VectorSpace< Vector< scalar >, scalar, 3 >::uniform().

Here is the call graph for this function:

◆ sideOfPlane()

Foam::plane::side sideOfPlane ( const point p) const
inline

Definition at line 80 of file planeI.H.

References p.

Referenced by boundBox::intersects().

Here is the caller graph for this function:

◆ sign()

int sign ( const point p,
const scalar  tol = SMALL 
) const
inline

Definition at line 88 of file planeI.H.

References p.

◆ mirror()

Foam::point mirror ( const point p) const

Definition at line 413 of file plane.C.

References Foam::distance(), and p.

Here is the call graph for this function:

◆ writeDict()

void writeDict ( Ostream os) const

Definition at line 428 of file plane.C.

References Ostream::beginBlock(), Ostream::endBlock(), os(), and Ostream::writeEntry().

Here is the call graph for this function:

The documentation for this class was generated from the following files: