You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The construction of a Torus is not entirely type stable as some parametric types of Torus
depend on the values and not the types of the input arguments to the constructor:
I think the best solution would be if we would came up with a way to remove the :inwards and :outwards parametric types of (all) surface primitives. Maybe by defining some field to those structs which only hold +1 or -1 in order to define the direction of surfaces like for the ConeMantle or TorusMantle.
However, we would still have the issue of the :flat case for the Torus.
Here, one (or two) of the surfaces of the Torus become not a ConeMantle but an EllipticalSurface: see TorusThetaSurface.
We would need to come up with a way to define these "flat" surfaces still as ConeMantle. In its current implementation of ConeMantle, this is not possible as hZ would be 0.
The text was updated successfully, but these errors were encountered:
This came up in #285.
The construction of a Torus is not entirely type stable as some parametric types of
Torus
depend on the values and not the types of the input arguments to the constructor:
The parametric types which cause the issue are
TT1
andTT2
of the Torus: https://github.com/SebastianRuffert/SolidStateDetectors.jl/blob/de2af27789cf8883f74ad0599acc60fc11aadd9a/src/ConstructiveSolidGeometry/VolumePrimitives/Torus.jl#L69.These define the types of two surfaces of the Torus. If we just remove
TT1
andTT2
from theTorus
we would shift the type instability into the functionsurfaces(t::Torus)
.I think the best solution would be if we would came up with a way to remove the
:inwards
and:outwards
parametric types of (all) surface primitives. Maybe by defining some field to those structs which only hold+1
or-1
in order to define the direction of surfaces like for theConeMantle
orTorusMantle
.However, we would still have the issue of the
:flat
case for theTorus
.Here, one (or two) of the surfaces of the
Torus
become not aConeMantle
but anEllipticalSurface
: seeTorusThetaSurface
.We would need to come up with a way to define these "flat" surfaces still as
ConeMantle
. In its current implementation ofConeMantle
, this is not possible ashZ
would be0
.The text was updated successfully, but these errors were encountered: