Rhino 5 ships with a version of IronPython (2.7.0), but we recommend updating your IronPython version to one of the newer releases, with a few caveats.
Sometimes you want to create functions on the fly, at runtime. This came up when using some of the SciPy optimisation functions that require constraints on the variables to be defined as functions.
Python has logical operators (like ‘and’) and bitwise operators (like ‘&’). Bitwise operators are not that common in Python code, but they can be extremely useful in some cases. For example, in RhinoPython they are used to work with geometry type filters.
After writing hundreds of lines of a code that executes a sophisticated operation in Rhino through a single click of a button, it would be nice to have a cool icon to go with it. This post highlights a few good web sources that provide general information and tips for customizing toolbar button icons in Rhino. Also included in the post is a short tutorial on how to create an icon from Adobe Illustrator.
pip install PyOpenGL PyOpenGL_accelerate
However, the official (Windows) release does not install the OpenGL Utility Toolkit.
With eight papers covering a wide range of exciting topics, the Block Research Group was strongly represented at the 2016 Symposium of the International Association for Shell and Spatial Sturctures (IASS), held September 26-30 at the University of Tokyo. You can check out all the papers on our website.
This post provides a list of Python functions that are very common in structural design calculations. They are not specifically optimised in any way. Therefore, you may end up using entirely different implementations in a real project. The list is a work in progress. I will try to add more examples soon…
Matplotlib is a great tool to visualise two-dimensional geometric data (and 3D data to some extent). You can also use it to dynamically visualise the convergence of an iterative solver.
Although NumPy and Scipy usually provide all the tools you need (and more) for scientific computing, sometimes you may want to use a bit of Matlab in the background. In my case, for example, to use
rref. Conveniently, Matlab can be run as a Python subprocess, provided of course that Matlab is installed on your system.
The normal way to add functionality (methods) to a class in Python is to define functions in the class body. There are many other ways to accomplish this that can be useful in different situations.