Some Python code that reads your opensees model's tcl files and shows you what it looks like
OpenSees model view is a Python package that can be used to visualise your OpenSees model as it is written. The script monitors a specified tcl file (or files) in which you define nodes, elements and fix conditions, and produces a drawing of the model. The model drawing will be updated each time you save the tcl file(s). The script will work for 2D/3dof and 3D/6dof models; but not for other combinations at the moment.
The visual feedback is intended to help you identify some model errors before execution, but mostly just makes you feel good.
At this stage, the project is best suited to structural models using elements that have an iNode and a jNode. I'm not sure if it will play nicely with geo elements.
model_view.py
into the directory where you keep your tcl files.model_view.py
in a text editor and set the values for tclfiles
and refresh_rate
. You can also change the style options to change the look of the view.model_view.py
and then edit your tcl file as normal. The viewer will refresh after you have saved your file and the refresh_rate
duration has been reached.2D model example | 3D model example |
---|---|
The package is written in Python3
with matplotlib
. I run Python3.6
and matplotlib2.0
, but I have no reason to think that this wouldn't work on earlier versions, as long as they are not too old. OpenSees
is not needed.
I'd really appreciate to hear from anyone who uses this package. I'm sure that it can be improved to better suit more people.