https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CSGPlane.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://www.mooseframework.org
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "CSGSurface.h"
13
14#include "libmesh/point.h"
15
16namespace CSG
17{
18
23class CSGPlane : public CSGSurface
24{
25public:
34 CSGPlane(const std::string & name, const Point & p1, const Point & p2, const Point & p3);
35
46 CSGPlane(const std::string & name, const Real a, const Real b, const Real c, const Real d);
47
51 virtual ~CSGPlane() = default;
52
59 virtual std::unordered_map<std::string, Real> getCoeffs() const override;
60
67 virtual Real evaluateSurfaceEquationAtPoint(const Point & p) const override;
68
69protected:
75 virtual std::unique_ptr<CSGSurface> clone() const override
76 {
77 return std::make_unique<CSGPlane>(_name, _a, _b, _c, _d);
78 }
79
80 // calculate the equivalent coeffients (aX + bY + cZ = d) from 3 points on a plane
81 void coeffsFromPoints(const Point & p1, const Point & p2, const Point & p3);
82
85
87 Real _a;
88
90 Real _b;
91
93 Real _c;
94
96 Real _d;
97};
98} // namespace CSG
CSGPlane creates an internal representation of a Constructive Solid Geometry (CSG) plane,...
Definition CSGPlane.h:24
void coeffsFromPoints(const Point &p1, const Point &p2, const Point &p3)
Definition CSGPlane.C:36
Real _b
Value of b in equation of plane.
Definition CSGPlane.h:90
Real _a
Value of a in equation of plane.
Definition CSGPlane.h:87
virtual ~CSGPlane()=default
Destructor.
virtual std::unordered_map< std::string, Real > getCoeffs() const override
get coefficients (a, b, c, d) of the Plane aX + bY + cZ = d
Definition CSGPlane.C:29
Real _d
Value of d in equation of plane.
Definition CSGPlane.h:96
virtual std::unique_ptr< CSGSurface > clone() const override
create clone of CSGPlane object
Definition CSGPlane.h:75
Real _c
Value of c in equation of plane.
Definition CSGPlane.h:93
virtual Real evaluateSurfaceEquationAtPoint(const Point &p) const override
given a point, determine its evaluation based on the equation of the plane
Definition CSGPlane.C:65
void normalizePlaneCoefficients()
Normalize plane coefficients so that a^2 + b^2 + c^2 = 1.
Definition CSGPlane.C:55
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface,...
Definition CSGSurface.h:27
std::string _name
Name of surface.
Definition CSGSurface.h:122