15CSGPlane::CSGPlane(
const std::string & name,
const Point & p1,
const Point & p2,
const Point & p3)
22CSGPlane::CSGPlane(
const std::string & name,
const Real a,
const Real b,
const Real c,
const Real d)
28std::unordered_map<std::string, Real>
31 std::unordered_map<std::string, Real> coeffs = {{
"a",
_a}, {
"b",
_b}, {
"c",
_c}, {
"d",
_d}};
40 RealVectorValue v1 = p2 - p1;
41 RealVectorValue v2 = p3 - p1;
42 RealVectorValue cross = v2.
cross(v1);
45 if (MooseUtils::absoluteFuzzyEqual(cross.norm(), 0))
46 mooseError(
"Provided points to define a CSGPlane are collinear");
51 _d = cross * (RealVectorValue)p1;
57 const auto k = 1. / std::sqrt(
_a *
_a +
_b *
_b +
_c *
_c);
69 const Real dot_prod =
_a * p(0) +
_b * p(1) +
_c * p(2);
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void coeffsFromPoints(const Point &p1, const Point &p2, const Point &p3)
Real _b
Value of b in equation of plane.
Real _a
Value of a in equation of plane.
virtual std::unordered_map< std::string, Real > getCoeffs() const override
get coefficients (a, b, c, d) of the Plane aX + bY + cZ = d
CSGPlane(const std::string &name, const Point &p1, const Point &p2, const Point &p3)
Construct a new CSGPlane surface from three non co-linear points.
Real _d
Value of d in equation of plane.
Real _c
Value of c in equation of plane.
virtual Real evaluateSurfaceEquationAtPoint(const Point &p) const override
given a point, determine its evaluation based on the equation of the plane
void normalizePlaneCoefficients()
Normalize plane coefficients so that a^2 + b^2 + c^2 = 1.
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface,...
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const