JuliaPhysics/SolidStateDetectors.jl

Negative torus does not contain center

hervasa2 opened this issue · 2 comments

Negative volumes do not include their surfaces as intended
However in the case of torus the "inner surface" at r_tube = 0 get omitted because of this.
See example tube with torus removed bellow

Screen Shot 2023-03-17 at 10 14 38 PM

"torus": {
    "r_torus": 5.0,
    "r_tube": {
        "from": 0.0,
        "to": 2.0
    },
    "theta": {
        "from": "0.0°",
        "to": "360.0°"
    },
    "origin": [
        0.0,
        0.0,
        70.0
    ]
}

Thanks for reporting.
The problem is that for the _in method for Torus, we do not distinguish between FullTorus and HollowTorus. Therefore, even for a FullTorus, r_tube_min = 0 is treated as a "real" boundary resulting in this unwanted behavior.
I will set up a PR to fix this now!

@hervasa2 Could you look through #331 ?