[Gate-users] Volume rotation along x, y and z different for each axis
STRYDHORST Jared
Jared.STRYDHORST at cea.fr
Tue Feb 23 17:13:46 CET 2016
I don't think it acts as a boolean, think of it as a vector that defines the axis about which the object is rotated. i.e. 1 0 0 for rotation in the yz plane, about the x axis.
There's never a need to rotate something three times in succession. The math is a bit tedious, but you can always reduce a series of rotations to a single rotation about some axis. I don't know it well enough to explain, but Google "Euler's rotation theorum."
If I understand correctly the rotation is only applied once in GATE, (if you call setRotationAxis or setRotationAngle a second time it just overwrites the first) so you'd need to work out the equivalent rotation axis and angle for the series of rotations you wish to apply. You can't build up rotations without creating daughter volumes as you've done.
Jared STRYDHORST
Laboratoire Imagerie Moléculaire In Vivo (IMIV)
UMR 1023 Inserm/CEA/Université Paris Sud - ERL 9218 CNRS
CEA/I2BM/Service Hospitalier Frédéric Joliot
4, place du Général Leclerc
91401 ORSAY Cedex
<mailto:karima.ait-aissa at cea.fr>
http://i2bm.cea.fr/dsv/i2bm/shfj/imiv
________________________________
De : gate-users-bounces at lists.opengatecollaboration.org [gate-users-bounces at lists.opengatecollaboration.org] de la part de Matt D [edw.d at outlook.fr]
Envoyé : mardi 23 février 2016 16:36
À : gate-users at lists.opengatecollaboration.org
Objet : [Gate-users] Volume rotation along x, y and z different for each axis
Dear Gaters,
I have difficulties rotating my volume as I want.
I've searched in previous mails from the mailing list and I saw that I was not alone !
From: Kesava S Kalluri <kkalluri at lsu.edu<mailto:kkalluri at lsu.edu>>
"hi,
/gate/cylinder/placement/enable
/gate/cylinder/placement/setRotationAxis -0.571 0.571 0.571 #(1/sqrt(3))
/gate/cylinder/placement/setRotationAngle 45 deg
/gate/cylinder/placement/setTranslation 1 1 1 cm
Following up with a previous thread, I was able to orient it @ 45* to each axis using these commands. Now I would like to orient the cylinder at 3 different angles with respect to each axis . Any ideas?"
First I've discovered that setRotationAxis acts as a boolean, so no need to put anything esle than 0 or 1.
So for example if I want to rotate my_volume 35° in both the x and y plan I would write :
/gate/my_volume/setRotationAxis 1 1 0
/gate/my_volume/setRotationAngle 35 deg
So that's all working fine, but now what if I want to rotate my volume, let's say, 10° in the x plan, 20° in the y and 30° in the z ?
If anyone has an answer to that, i'm ready to ship a mars bar !
I thought about a possible solution which is to:
- rotate a volume in one plan
- create a daughter to this volume (benefiting from the initial rotation) and rotate it in another plan
- create a third grand-daughter volume and rotate in the last plan if needed
But first, it seems crazy complicated to do something that I'm sure is really simple (and I'm too dumb to have thought about it), and second, each time I rotate the daughter volume I need to expand the mother volume and I create some dead space where I cannot put any other volume if I don't want deadly overlapping volumes.
Any ideas would be much appreciated :)
Ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20160223/3c39f2df/attachment-0001.html>
More information about the Gate-users
mailing list