[fluka-discuss]: nested geometry directives

From: Timotheus Cooijmans <tim.cooijmans_at_cern.ch>
Date: Fri, 19 Sep 2014 14:48:25 +0000

Hello Fluka experts,

I am trying to understand the behavior of geometry directives when nested. At first I assumed that nesting directives would simply compose the corresponding transformations, in other words the directives would be applied from innermost to outermost. However, I now see that the manual says:

> $Start_expansion takes precedence over $Start_translat, which in turn takes precedence over $Start_transform.

If this is true, then something trivial like rotation around a pivot (dx, dy, dz) is going to be complicated. Intuitively, it would be

    $Start_translat dx dy dz
    $Start_transform <some rotation around (0, 0, 0)>
    $Start_translat -dx -dy -dz
    ...body definitions...
    $End_translat
    $End_transform
    $End_translat

but if I understand the excerpt from the manual correctly, the translations would take precedence and cancel out, leaving only the rotation around (0, 0, 0), which is incorrect.

I could offload the innermost translation to the $Start_transform directive:

    $Start_translat dx dy dz
    $Start_transform <translation by -dx -dy -dz and some rotation around (0, 0, 0)>
    ...body definitions...
    $End_transform
    $End_translat

But the outer translation would take precedence and I would in fact be rotating around (0, 0, 0) again.

I guess the solution would be to apply an inverse rototranslation like so:

    $Start_transform -<translation by -dx -dy -dz and then some rotation around (0, 0, 0) which is the inverse of the rotation I actually want to do>
    $Start_translat -dx -dy -dz
    ...body definitions...
    $End_translat
    $End_transform

but it's confusing, and this is only one particular class of composite transformation I'm trying to implement; I was hoping to be able to generate geometry directives programmatically without having to worry about contextual complications.

Do I understand the situation correctly? Is this the kind of thing I have to do?

Many thanks,
Tim
Received on Fri Sep 19 2014 - 18:12:01 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 19 2014 - 18:12:02 CEST