|
Celeritas 0.7.0-dev.170+develop.df22d2a88
|
An azimuthally sliced arbitrary polygon revolved around the z axis. More...
#include <RevolvedPolygon.hh>

Public Types | |
Type aliases | |
| using | SPConstObject = std::shared_ptr< ObjectInterface const > |
| using | VecReal2 = std::vector< Real2 > |
Public Types inherited from celeritas::orangeinp::ObjectInterface | |
| using | SPConstObject = std::shared_ptr< ObjectInterface const > |
| using | VolumeBuilder = detail::VolumeBuilder |
Public Member Functions | |
| RevolvedPolygon (std::string &&label, VecReal2 &&polygon, EnclosedAzi &&enclosed) | |
| Construct from a polygon. | |
| std::string_view | label () const final |
| Get the user-provided label. | |
| NodeId | build (VolumeBuilder &) const final |
| Construct a volume from this object. | |
| void | output (JsonPimpl *) const final |
| Write the shape to JSON. | |
| VecReal2 const & | polygon () const |
| Get the polygon. | |
| EnclosedAzi const & | enclosed_azi () const |
| Get the azimuthal angular restriction. | |
Public Member Functions inherited from celeritas::orangeinp::ObjectInterface | |
| virtual | ~ObjectInterface ()=0 |
| Anchored default destructor. | |
Additional Inherited Members | |
Protected Member Functions inherited from celeritas::orangeinp::ObjectInterface | |
| CELER_DEFAULT_COPY_MOVE (ObjectInterface) | |
An azimuthally sliced arbitrary polygon revolved around the z axis.
The polygon must be specified in counterclockwise order and may not be self intersecting. The polygon cannot cross the z axis, i.e., all vertices must satisfy r >= 0.
Construction is performed using a convex differences tree approach (tor-convexdecomp-1984). The convex hull of the polygon is first found and revolved around the z axis. Regions that constitute the difference between the convex hull and the original polygon are then subtracted. Each of these regions is created recursively in the same fashion. The recursion depth is referred to as the "level" and each contiguous region within a level is a "region", as shown below:
original polygon convex hull difference |___ ____ |____________ | ______ ^ | \ | | | | | \ | level 1 | | \ | | | | | \ | region 0 z | \| | | level 0 | | \| | | = | region 0 | - | a | | | | | x | /\ | | | | /\ level 1 i |___/ \____| |___________| | /__\ region 1 s |_____________ |_____________ |_____________ r axis ->
Convex "regions" are constructed from "subregions", as shown below:
| ______ |________ |___
^ | \ | level 1 | | level 1 | \ level 1
| | \ | region 0 | | region 0 | \ region 0
z | \| |________| subregion 0 |_______\ subregion 1
| = | (a cylinder) - | (a cone)
a | | |
x | | |
i | | |
s |_____________ |_____________ |_____________
r axis ->
In this example, level 1 region 0 is formed from only two subregions, but the general case is handled via:
region = union(outer subregions) - union(inner subregions).
The final step in construction is azimuthal truncation, which is done through a union operation with a negated or non-negated EnclosedAzi.
When labeling nodes in the CSG output, the following shorthand format is used: label@level.region.subregion. For example, the final subregion in the example above might be named my_shape@1.0.1. For each level, additional nodes are created in the form: label@level.suffix where suffixes have the following meanings:
For each region, additional nodes are created in the form label.nosp@m.@lev.nosp@m.el.re.nosp@m.gion.nosp@m..suff.nosp@m.ix where suffixes have the following meanings:
If the supplied EnclosedAzi object is true (truncating), additional nodes with the following extensions are added:
|
finalvirtual |
Construct a volume from this object.
Construct a volume from this shape.
Implements celeritas::orangeinp::ObjectInterface.
|
inlinefinalvirtual |
Get the user-provided label.
Implements celeritas::orangeinp::ObjectInterface.
Write the shape to JSON.
Implements celeritas::orangeinp::ObjectInterface.