|
Celeritas 0.7.0-dev.356+develop.6a0c715
|
Z-aligned Elliptical Toroid. More...
#include <Toroid.hh>
Type aliases | |
| using | Intersections = Array< real_type, 4 > |
| Location of center of toroid. | |
| using | StorageSpan = Span< real_type const, 6 > |
| Location of center of toroid. | |
| using | Real3 = Array< real_type, 3 > |
| Location of center of toroid. | |
| using | Real4 = Array< real_type, 4 > |
| Location of center of toroid. | |
| using | Real5 = Array< real_type, 5 > |
| Location of center of toroid. | |
| static SurfaceType | surface_type () |
| Location of center of toroid. | |
| static constexpr bool | simple_safety () |
| Safety distance is calculable w/xy of normal and ellipse safety distance, but this is out of scope at first and might not be trivially calculable https://web.archive.org/web/20170829172516/https://www.spaceroots.org/documents/distance/distance-to-ellipse.pdf. | |
| Toroid (Real3 const &origin, real_type major_radius, real_type ellipse_xy_radius, real_type ellipse_z_radius) | |
| Construct toroid from origin point and radii. | |
| template<class R > | |
| Toroid (Span< R, StorageSpan::extent >) | |
| Construct from raw data. | |
| Real3 const & | origin () const |
| Center of the toroid (in the donut hole) | |
| real_type | major_radius () const |
| Radius from origin to center of revolved ellipse. | |
| real_type | ellipse_xy_radius () const |
| Radius of revolved ellipse along xy plane. | |
| real_type | ellipse_z_radius () const |
| Radius of revolved ellipse along z axis. | |
| StorageSpan | data () const |
| View of data for type-deleted storage. | |
| SignedSense | calc_sense (Real3 const &pos) const |
| Determine the sense of the position relative to this surface. | |
| Intersections | calc_intersections (Real3 const &pos, Real3 const &dir, SurfaceState on_surface) const |
| Calculate all possible straight-line intersections between the given ray and this surface. | |
| Real3 | calc_normal (Real3 const &pos) const |
| Calculate outward facing normal at a position on or close to the surface. | |
Z-aligned Elliptical Toroid.
An elliptical toroid is a shape created by revolving an axis-aligned ellipse around a central axis. This shape can be used in everything from pipe bends to tokamaks in fusion reactors. It possesses a major radius r, and ellipse radii a and b, as shown in the below diagram:
___ _________ ___ / | \ / \ / b \ / \ | | | | | |-a--+ | o-----r--+ | | | | | \ / \ / \...../...........\...../
This torus can be defined with the following quartic equation:
\[ (x^2 + y^2 + p*y^2 + B_0) - A_0 * (x^2 + y^2) = 0 \]
where \(p = a^2/b^2 \), \(A_0 = 4 r^2 \), and \( B_0 = (r^2-a^2)\).
The intersection is calculated using an algorithm from [arvo-graphicsgems-1995].
|
explicit |
Construct toroid from origin point and radii.
| origin | 3d origin of the toroid. |
| major_radius | Radius from origin to the center of revolved ellipse. |
| ellipse_xy_radius | Radius of ellipse in xy plane, aka 'a'. |
| ellipse_z_radius | Radius of ellipse aligned with z axis, aka 'b'. |
|
inline |
Determine the sense of the position relative to this surface.
For a toroid, being inside the toroid (i) counts as inside, outside (including in the 'hole' region) (o) as outside, and on the surface exactly as on (s).
___ _________ ___
/ \ / \
/ \ o / \
| | | | o
| | | i s
\ / \ /
\ / \ /
⁻⁻⁻ ⁻⁻⁻⁻⁻⁻⁻⁻⁻ ⁻⁻⁻