A couple weeks ago I attended the AIAA Aviation conference in Washington D.C. to work the booth and talk with current and prospective Pointwise users. I enjoy attending conferences because it gives me an additional opportunity to see how Pointwise is being used in the real world and to gather feedback from our user base.
One user dropped by our booth in the exhibition hall and mentioned to me that it would be nice if he could specify a rotation angle about any axis when manipulating the scene. He was aware of our hotkeys to perform 3-degree and 90-degree rotations, but wanted more control. I mentioned Glyph and could tell he was not too keen on scripting.
This series aims to break down the barriers and dissolve any misconceptions regarding Glyph. Certainly, features such as the one our user requested could find their way into Pointwise. Yet, scripting provides the means of personalizing a feature or utility.
In this case, through a handful of Glyph calls, our user can now rotate a number of degrees about any axis. Sales & Marketing intern Rajib Roy and I set out to write this script and had a working version in less than an hour. A user interface with a few additional options were added a day later. The main procedure, RotateView, is only 10 lines of code and can be condensed even further if desired. That’s it…just 10 lines. Most utility scripts are similar. Only a handful of lines are required to drive Pointwise using Glyph.
The RotateView.glf script presents the user with a Tk interface and prompts them to either explicitly specify a rotation angle about the body-axis or pick one of three isometric views. The three isometric views first align with either the x, y, or z-axis and then apply two independent rotations. An animation of the scene rotation is enabled by default, and the view can be reset to undo all rotation operations performed by the script. Lastly, each command has an associated hotkey to make operation as seamless as possible.
Do you have an idea or a Glyph script you’ve written that you would like to share with us? Let us know in the comments below or on Twitter @Pointwise.