Incremetal rotation

Moderator: GiD Team

Post Reply
User avatar
vpapanik
Posts: 49
Joined: Sat Oct 08, 2016 1:05 pm

Incremetal rotation

Post by vpapanik »

Is it possible to write a macro that performs a rotation increment of the current by a specific axis and angle ?
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Incremetal rotation

Post by escolano »

Off course you can write a Tcl proc invoked from a macro button.
What do you want?
a) modify the geometry or mesh coordinates by rotation
b) do not modify coordinates, rotate only the view

To do a) you can basically do the same as the Utilities->Move... window
(do the operation as user and open the Undo window to see the 'GiD process' words done)
In your tcl proc you can use the special Tcl command GiD_Process to send your words to GiD to be processed.

to do b) use some View->Rotate... tool and the same, identify the GiD process keywords to do something similar in your Tcl proc.
User avatar
vpapanik
Posts: 49
Joined: Sat Oct 08, 2016 1:05 pm

Re: Incremetal rotation

Post by vpapanik »

View rotation only.
I did that using several different scripts and buttons for different angles.

What I was looking for is to somehow to write/read the current state of rotation and apply only a positive/negative increment with just two buttons.
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Incremetal rotation

Post by escolano »

There is a Rotate ScreenAxesIncrement process command, to rotate an increment or angle around axes x y or z

e.g to rotate around z axis:
GiD_Process 'Rotate ScreenAxesIncrement z $angle_degrees

Usually the rotation center is dinamically set by GiD (Utilities->Preferences - Graphical->Appearance: "Automatic rotation center" checkbox)

you can also set it to a value with

GiD_Process 'Rotate Center $x,$y,$z

but off course with 'automatic rotation center' it will be recalculated when changing the view

For more advanced programming features, it is possible to use most OpenGL commands from Tcl with
GiD_OpenGL
But this is much more complicated to do. There are lot of OpenGL books to learn it.
User avatar
vpapanik
Posts: 49
Joined: Sat Oct 08, 2016 1:05 pm

Re: Incremetal rotation

Post by vpapanik »

This is more than enough, thanks a very lot again !!!
Post Reply