Python app for interactive visualization of 3D structures, mode shapes and animations.
The python app is in a beta version and it is recommended to use the web app for now.
The python app can open SubDyn and HydroDyn inputs files (.dat), and SubDyn yaml files (.yaml) to display the structure and potentially the mode shapes (SubDyn yaml file).
###Installation:
git clone --recurse-submodules http://github.com/ebranlard/pyviz3danim
cd pyviz3danim
python -m pip install -r requirements.txt
cd weio
python -m pip install -e .
cd ..
If you forgot the recurse-submodules
flag, and you end up with errors that weio
is missing, type the following:
git submodule update --init --recursive
###Running:
python pyviz3danim.py
Drag and drop files.
NOTE: the json file format is not fully supported by the python app yet. Use SubDyn or HydroDyn or DubDyn yaml files for now.
The input files are .json
files. You can see an example below.
The content of the file is as follows:
Nodes
: a list of nodal coordinates (x,y,z) for each nodeConnectivity
: a connectivity matrix providing the node indices defining each element (for now elements consists of two nodes)ElemeProps
: properties for each elementModes
: optional field providing the modes of the structure.TimeSeries
: optional field providing the time series of displacements of the structure. The format is mostly undocumented for now, it might evolve in the future. Example files are located in theexamples
folder of this repository.
The json
files can be generated using:
-
SubDyn (part of OpenFAST). Setting the options
OutCBModes
andOutFEMModes
, see here. -
The python module
graph.py
and finite element (FEM) module of welib. See examples.
{"Connectivity":[
[0, 1],
[1, 2],
[2, 0]
],
"Nodes": [
[ 0.0, 0.0, 1.0],
[ 0.0,-0.25, 0.0],
[ 0.0, 0.25, 0.0]
],
"ElemProps": [
{"shape": "cylinder", "Diam": 0.1},
{"shape": "cylinder", "Diam": 0.2},
{"shape": "cylinder", "Diam": 0.1}
],
"Modes": {
"defaultSet": [
{"name": "Mode1", "Displ": [[0.0, 0.0, 0.0], [0.3, 0.0, 0.0], [0.3, 0.0, 0.0]]},
{"name": "Mode2", "Displ": [[0.0, 0.0, 0.0], [0.0, 0.3, 0.0], [0.0, 0.3, 0.0]]}
]
}
}