Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using rotation in DDCAD to rotate around z axis #1200

Closed
armin-ilg opened this issue Dec 13, 2023 · 2 comments
Closed

Using rotation in DDCAD to rotate around z axis #1200

armin-ilg opened this issue Dec 13, 2023 · 2 comments
Labels

Comments

@armin-ilg
Copy link

  • OS version: lxplus7
  • Release: Latest key4hep release (/cvmfs/sw.hsf.org/key4hep/releases/2023-11-23/x86_64-centos7-gcc12.2.0-opt/key4hep-stack/2023-11-30-yi2hqy/setup.sh)
  • Package version:master
  • Reproduced by: Generating root file of geometry of examples/DDCAD/compact/DD4hep_Issue_1134.xml using script from k4geo. Looking at the resulting geometry in a TBrowser yields:
    Screenshot 2023-12-13 at 11 44 29
    where the Z axis goes through the two volumes. I now want to rotate around the Z axis, but doing so by setting z="4pi/8rad" in
    examples/DDCAD/compact/DD4hep_Issue_1134.xml rotates around another axis:
    Screenshot 2023-12-13 at 11 38 45
    If I instead change the angle in x or y, this also never yields in a rotation around the z axis. On a first look I didn't find the source of this problem in DD4hep. Do you have an idea where the issue could come from?

Thank you and kind regards,
Armin

@armin-ilg armin-ilg added the bug label Dec 13, 2023
@MarkusFrankATcernch
Copy link
Contributor

@armin-ilg
I am afraid this is not as simple as that.

The CAD volume of the STL file is NOT positioned at the origin of its volume frame.
(Remove the transformation in the xml to see where it originally is).
In order to simply use a Z-rotation you will probably need to place the current setup into an assembly with
a coordinate frame in the true origin. Then you can rotate this "envelope-assembly" the way you want.
Just changing the Z rotation cannot really work. Also keep in mind you deal here with a ZYX rotation.

@MarkusFrankATcernch
Copy link
Contributor

Please see PR 1259 on an example how to properly deal with CAD shapes, which are not placed at the origin.
Screenshot from 2024-05-07 11-14-46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants