Celeritas 0.6.0-129+develop.846910afa
|
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 > |
![]() | |
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. | |
![]() | |
virtual | ~ObjectInterface ()=0 |
Anchored default destructor. | |
Additional Inherited Members | |
![]() | |
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:
1) .cu : the union of all concave regions on the level, 2) .ncu : the negation of .cu, 3) .d : the difference between the level's convex hull and .cu.
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:
1) .ou : the union of nodes that comprise the outer boundary of the region, 2) .iu : the union of nodes that comprise the inner boundary of the region, 3) .nui : the negation of .ui, 4) .d : the difference between .ou and .iu.
If the supplied EnclosedAzi object is not [0, 2pi], additional nodes with the following extensions are added:
1) azi/~azi : the enclosed, possibly negated, azimuthal angle, 2) restricted : the intersection of the revolved polygon and azi/~azi.
|
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.