Geometric class that creates a 2D plane and can return the intersection point between a line and the plane. More...
Data Structures | |
class | ray |
A direction and a reference point. More... | |
Public Types | |
enum | side { NORMAL, FLIP } |
Side of the plane. More... | |
Public Member Functions | |
plane (const vector &normalVector) | |
Construct from normal vector through the origin. More... | |
plane (const point &basePoint, const vector &normalVector) | |
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 &C) | |
Construct from coefficients for the. More... | |
plane (const dictionary &planeDict) | |
Construct from dictionary. More... | |
plane (Istream &is) | |
Construct from Istream. Assumes the base + normal notation. More... | |
const vector & | normal () const |
Return plane normal. More... | |
const point & | refPoint () const |
Return or return plane base point. More... | |
FixedList< scalar, 4 > | planeCoeffs () const |
Return coefficients for the. More... | |
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 from the given point to the plane. More... | |
scalar | normalIntersect (const point &pnt0, const vector &dir) const |
Return cut coefficient for plane and line defined by. More... | |
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 &) const |
Return the cutting line between this plane and another. More... | |
point | planePlaneIntersect (const plane &, const plane &) const |
Return the cutting point between this plane and two other planes. More... | |
side | sideOfPlane (const point &p) const |
Return 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 &) const |
Write to dictionary. More... | |
Private Member Functions | |
void | calcPntAndVec (const scalarList &C) |
Calculates basePoint and normal vector given plane coefficients. More... | |
void | calcPntAndVec (const point &point1, const point &point2, const point &point3) |
Private Attributes | |
vector | unitVector_ |
Plane normal. More... | |
point | basePoint_ |
Base point. More... | |
Friends | |
bool | operator== (const plane &, const plane &) |
bool | operator!= (const plane &, const plane &) |
Ostream & | operator<< (Ostream &, const plane &) |
Write plane properties. More... | |
Geometric class that creates a 2D plane and can return the intersection point between a line and the plane.
Construct from normal vector through the origin.
Definition at line 114 of file plane.C.
References Foam::abort(), plane::basePoint_, Foam::FatalError, FatalErrorInFunction, Foam::mag(), and plane::unitVector_.
Construct from normal vector and point in plane.
Definition at line 135 of file plane.C.
References Foam::abort(), plane::basePoint_, Foam::FatalError, FatalErrorInFunction, Foam::mag(), and plane::unitVector_.
Construct from three points in plane.
Definition at line 164 of file plane.C.
References Foam::constant::physicoChemical::b, and Foam::constant::universal::c.
plane | ( | const scalarList & | C | ) |
plane | ( | const dictionary & | planeDict | ) |
Construct from dictionary.
Definition at line 175 of file plane.C.
References Foam::abort(), plane::basePoint_, C, plane::calcPntAndVec(), dict, Foam::FatalIOError, FatalIOErrorInFunction, dictionary::lookup(), Foam::mag(), Foam::nl, Foam::readScalar(), and plane::unitVector_.
Construct from Istream. Assumes the base + normal notation.
Definition at line 225 of file plane.C.
References Foam::abort(), plane::basePoint_, Foam::FatalError, FatalErrorInFunction, Foam::mag(), and plane::unitVector_.
|
private |
Calculates basePoint and normal vector given plane coefficients.
Definition at line 32 of file plane.C.
References Foam::abort(), plane::basePoint_, Foam::FatalError, FatalErrorInFunction, Foam::mag(), and plane::unitVector_.
Referenced by plane::plane().
Calculates basePoint and normal vector given three points Normal vector determined using right hand rule
Definition at line 74 of file plane.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), and Foam::nl.
const Foam::vector & normal | ( | ) | const |
Return plane normal.
Definition at line 248 of file plane.C.
Referenced by searchablePlane::calcBounds(), coordinateModifier::checkForValidInverse(), sampledCuttingPlane::createGeometry(), geomCellLooper::cut(), triSurfaceTools::cutEdge(), meshUntangler::cutRegion::findNewVertices(), main(), meshUntangler::optimizeNodePosition(), plane::planeIntersect(), Foam::help::planeIntersectsEdge(), tetrahedron::tetSliceWithPlane(), meshSurfaceOptimizer::transformIntoPlane(), triangle< Foam::Vector, Foam::Vector >::triSliceWithPlane(), and Foam::help::vertexInPlane().
const Foam::point & refPoint | ( | ) | const |
Return or return plane base point.
Definition at line 255 of file plane.C.
Referenced by coordinateModifier::checkForValidInverse(), sampledCuttingPlane::createGeometry(), triSurfaceTools::cutEdge(), meshUntangler::cutRegion::findNewVertices(), main(), meshUntangler::optimizeNodePosition(), plane::planeIntersect(), Foam::help::planeIntersectsEdge(), tetrahedron::tetSliceWithPlane(), triangle< Foam::Vector, Foam::Vector >::triSliceWithPlane(), and Foam::help::vertexInPlane().
Foam::FixedList< Foam::scalar, 4 > planeCoeffs | ( | ) | const |
Return coefficients for the.
plane equation: ax + by + cz + d = 0
Definition at line 262 of file plane.C.
References C, and Foam::mag().
Referenced by plane::planePlaneIntersect().
Foam::point nearestPoint | ( | const point & | p | ) | const |
Return nearest point in the plane for the given point.
Definition at line 310 of file plane.C.
References p.
Referenced by quadricFitting::calculateCoordinateSystem(), Foam::help::isFaceConvexAndOk(), meshSurfaceOptimizer::newPositionLaplacian(), meshSurfaceOptimizer::newPositionLaplacianFC(), meshSurfaceOptimizer::newPositionLaplacianWFC(), meshSurfaceOptimizer::nodeDisplacementLaplacianFCParallel(), meshSurfaceOptimizer::nodeDisplacementLaplacianParallel(), and meshSurfaceOptimizer::transformIntoPlane().
Foam::scalar distance | ( | const point & | p | ) | const |
Return distance from the given point to the plane.
Definition at line 317 of file plane.C.
References Foam::mag(), and p.
Referenced by geomCellLooper::cut().
Return cut coefficient for plane and line defined by.
origin and direction
Definition at line 325 of file plane.C.
References Foam::stabilise().
Referenced by geomCellLooper::cutEdge(), plane::lineIntersect(), plane::normalIntersect(), and faceTriangulation::rayEdgeIntersect().
|
inline |
Return cut coefficient for plane and ray.
Definition at line 172 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 180 of file plane.H.
References plane::normalIntersect(), line::start(), and line::vec().
Referenced by slidingInterface::coupleInterface(), deleteEdges(), and slidingInterface::modifyMotionPoints().
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 337 of file plane.C.
References Foam::mag(), plane::normal(), plane::refPoint(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by autoSnapDriver::featureAttractionUsingReconstruction().
Foam::point planePlaneIntersect | ( | const plane & | plane2, |
const plane & | plane3 | ||
) | const |
Return the cutting point between this plane and two other planes.
Definition at line 406 of file plane.C.
References Foam::constant::physicoChemical::b, Foam::inv(), and plane::planeCoeffs().
Referenced by autoSnapDriver::featureAttractionUsingReconstruction().
Foam::plane::side sideOfPlane | ( | const point & | p | ) | const |
Foam::point mirror | ( | const point & | p | ) | const |
Mirror the supplied point in the plane. Return the mirrored point.
Definition at line 436 of file plane.C.
References Foam::distance(), and p.
void writeDict | ( | Ostream & | os | ) | const |
Write to dictionary.
Definition at line 451 of file plane.C.
References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, token::END_STATEMENT, Foam::endl(), Foam::incrIndent(), Foam::indent(), Foam::nl, and Ostream::writeKeyword().
|
private |
Plane normal.
Definition at line 104 of file plane.H.
Referenced by plane::calcPntAndVec(), Foam::operator<<(), Foam::operator==(), and plane::plane().
|
private |
Base point.
Definition at line 107 of file plane.H.
Referenced by plane::calcPntAndVec(), Foam::operator<<(), Foam::operator==(), and plane::plane().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.