21 mooseError(
"N-sided polygon engineering unit " + name +
" must have 3 or more sides.");
23 mooseError(
"N-sided polygon engineering unit " + name +
" apothem must be positive.");
38 -std::numeric_limits<Real>::max();
42 (p(0) * std::cos(2.0 * M_PI * k /
_n_sides) + p(1) * std::sin(2.0 * M_PI * k /
_n_sides)) -
50std::unordered_map<std::string, AttributeVariant>
80 std::string base_name =
getName() +
"_expanded_surf_";
84 auto sname = base_name + std::to_string(k);
85 a = std::cos(2.0 * M_PI * k /
_n_sides);
86 b = std::sin(2.0 * M_PI * k /
_n_sides);
87 std::unique_ptr<CSG::CSGPlane> s_ptr = std::make_unique<CSG::CSGPlane>(sname, a, b, c, d);
91 auto hp_type = surf.getHalfspaceFromPoint(p);
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
std::unique_ptr< CSGBase > _internal_base
CSGBase populated by expandUnit(); joined into the parent CSGBase by expandEngUnit()
Real evaluateSurfaceEquationAtPoint(const Point &p) const override
Evaluate the polygon's surface equation at the given point.
std::unordered_map< std::string, AttributeVariant > getAttributes() const override
Return the polygon attributes for this object.
const int _n_sides
Number of sides of the regular polygon.
void expandUnit() override
Create N CSGPlane surfaces in _internal_base, one per polygon side.
const Real _apothem
Distance from the polygon center to the midpoint of each side.
CSGNPolygonUnit(const std::string &name, int n_sides, Real apothem)
Construct a new CSGNPolygonUnit.
RegionType getRegionType() const
Get the region type.
CSGSurfaceEngUnit is an abstract base class for "engineering units" that can be used as surfaces in c...
CSGRegion _expanded_region
Stores the result of expandUnit(); EMPTY until then.
const std::string & getName() const override
Satisfy CSGEngUnit::getName() – resolved via CSGSurface::getName()