Mantid
Loading...
Searching...
No Matches
Functions
Mantid::Geometry::CoplanarChecks Namespace Reference

Functions

bool allCoplanar (const std::vector< Kernel::V3D > &vertices, const Kernel::V3D &normal)
 Establish if all vertices are coplanar. More...
 
bool sufficientPoints (const std::vector< Kernel::V3D > &vertices)
 
Kernel::V3D surfaceNormal (const std::vector< Kernel::V3D > &vertices)
 Establish the first surface normal. More...
 
Kernel::V3D validatePointsCoplanar (const std::vector< Kernel::V3D > &vertices)
 Establish the surface normal for a set of vertices. More...
 

Function Documentation

◆ allCoplanar()

bool Mantid::Geometry::CoplanarChecks::allCoplanar ( const std::vector< Kernel::V3D > &  vertices,
const Kernel::V3D normal 
)

Establish if all vertices are coplanar.

Parameters
vertices: All vertices to check
normal: Surface normal
Returns
True only if all vertices are coplanar

Definition at line 55 of file MeshObject2D.cpp.

References Mantid::Geometry::d, Mantid::Kernel::V3D::norm(), tolerance, and Mantid::Kernel::V3D::X().

Referenced by Mantid::Geometry::MeshObject2D::pointsCoplanar(), and validatePointsCoplanar().

◆ sufficientPoints()

bool Mantid::Geometry::CoplanarChecks::sufficientPoints ( const std::vector< Kernel::V3D > &  vertices)

◆ surfaceNormal()

Kernel::V3D Mantid::Geometry::CoplanarChecks::surfaceNormal ( const std::vector< Kernel::V3D > &  vertices)

Establish the first surface normal.

Tries to establish normal from non-colinear points

Parameters
vertices: All vertices
Returns
surface normal, or 0,0,0 if not found

Definition at line 34 of file MeshObject2D.cpp.

Referenced by Mantid::Geometry::MeshObject2D::pointsCoplanar(), and validatePointsCoplanar().

◆ validatePointsCoplanar()

Kernel::V3D Mantid::Geometry::CoplanarChecks::validatePointsCoplanar ( const std::vector< Kernel::V3D > &  vertices)

Establish the surface normal for a set of vertices.

Throw invalid_argument if colinear or non-coplanar vertices found.

Parameters
vertices: all vertices to consider
Returns
: normal to surface formed by points

Definition at line 83 of file MeshObject2D.cpp.

References allCoplanar(), sufficientPoints(), and surfaceNormal().

Referenced by Mantid::Geometry::MeshObject2D::initialize().