You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ahref="https://www.buymeacoffee.com/hTpOQGl"rel="nofollow"><imgalt="Donate just a small amount, buy me a coffee!"src="https://warehouse-camo.cmh1.psfhosted.org/1c939ba1227996b87bb03cf029c14821eab9ad91/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d4275792532306d6525323061253230636f666665652d79656c6c6f77677265656e2e737667"></a>
1
3
# viz3Danim
2
4
3
-
Visualize 3D structures, mode shapes and animations.
5
+
Interactive visualization of 3D structures, mode shapes and animations, using a json file format (described [here](json-file-format)).
4
6
5
-
Two different applications are provided:
6
7
7
-
- a web browser app (.json files), see the active version [with an example](https://ebranlard.github.io/viz3Danim/index.html?load=examples/OC4_Jacket_All.sum.json) or [without](https://ebranlard.github.io/viz3Danim/)
This program is a "web app", meaning that it can run in a web browser, with no installation needed.
12
+
The app can be run without internet on your local machine (provided you have python installed).
11
13
12
-
See documentation below for the Python app and Web App.
13
-
14
+
For convenience, we provide a live and active version hosted on github.io, [with an example](https://ebranlard.github.io/viz3Danim/index.html?load=examples/OC4_Jacket_All.sum.json) or [without example](https://ebranlard.github.io/viz3Danim/).
14
15
16
+
NOTE: no files are stored on the server, no cookies are used, everything is run on the client side. It should be safe to use confidential files on this live version. For increased privacy, see [how to run the Web App locally](#running-the-web-app-locally).
15
17
18
+
A python app is in development [here](https://github.com/ebranlard/pyviz3danim) but is still in "beta".
16
19
17
20
18
21
## Json file format
19
-
The input files are `.json` files. The content of the file is faily simple: list of nodes, connectivity matrix defining elements, and nodal displacements for each modes/time series.
20
-
The format is undocumented for now, as it might evolve in the future.
21
-
Example files are located in the `examples` folder of this repository.
22
+
The input files are `.json` files. You can see [a simple example](#a-simple-example-of-json-file) below, and more advanced examples in the [examples](/examples/) directory of this repository.
22
23
24
+
The content of the file is as follows:
23
25
24
-
The `json` files can be generated using:
26
+
-`Nodes`: a list of nodal coordinates (x,y,z) for each node
27
+
-`Connectivity`: a connectivity matrix providing the node indices defining each element (for now elements consists of two nodes)
28
+
-`ElemeProps`: properties for each element
29
+
-`Modes`: optional field providing the modes of the structure.
30
+
-`TimeSeries`: optional field providing the time series of displacements of the structure.
31
+
The format is mostly undocumented for now, it might evolve in the future.
32
+
Example files are located in the `examples` folder of this repository.
33
+
34
+
The `.json` files can be generated using:
25
35
26
36
- SubDyn (part of [OpenFAST](https://github.com/openfast/openfast)). Setting the options `OutCBModes` and `OutFEMModes`, see [here](https://openfast.readthedocs.io/en/dev/source/user/subdyn/input_files.html#output-summary-and-outfile).
27
37
28
-
- The python module `graph.py` and finite element (FEM) module of [welib](https://github.com/ebranlard/welib). See [examples](https://github.com/ebranlard/welib/tree/dev/welib/FEM/examples).
38
+
- The python module `graph.py` and finite element (FEM) module of [welib](https://github.com/ebranlard/welib). See the [welib FEM examples](https://github.com/ebranlard/welib/tree/dev/welib/FEM/examples).
39
+
40
+
41
+
### A simple example of Json file:
42
+
43
+
Below is an example of json file where a triangle, made of three nodes and three elements.
44
+
Two "modes" are included, where the base of the triangle moves rigidly along the x or y direction.
A live and active version of the web GUI is available [here with an example](https://ebranlard.github.io/viz3Danim/index.html?load=examples/OC4_Jacket_All.sum.json) or [here without an example](https://ebranlard.github.io/viz3Danim/).
34
78
79
+
You can also launch a local version of the Web App on your machine, without the need for an internet connection. See [how to run the Web App locally](#running-the-web-app-locally).
80
+
81
+
35
82
### Basic help
36
83
37
-
- To open a file in the Web App, simply dragging and drop a `json` file into your browser.
84
+
- To open a file in the Web App, simply drag and drop a `json` file into your browser. You can alternatively use the the dropdown menu "Menu > Load"
38
85
39
86
- For more help, look at "Menu -> Help", in particular for some keyboard shortcuts to scale the modes amplitudes and frequencies.
40
87
41
88
### Keyboard shortcuts
42
-
a: increase amplitude
43
-
d: decrease amplitude
44
-
w: speed up
45
-
s: slow down
89
+
a: increase amplitude of modes
90
+
d: decrease amplitude of modes
91
+
w: speed up modes or animation
92
+
s: slow down modes or animation
46
93
47
94
48
95
49
96
### Running the Web App locally.
50
-
You can run with Web App without internet. Simply clone this repository, install the dependencies (`python -m pip install -r requirements.txt`) and run `make server` from the root of the repository.
51
-
This should create a local web server and launch the local version of the web app into your browser.
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
## Python App (Beta)
60
-
61
-
The python app can open SubDyn and HydroDyn inputs files (.dat), and SubDyn yaml files (.yaml) to display the modes.
62
-
63
-
###Installation:
97
+
You can run with Web App locally and without internet for convenience and confidentiality is of concern.
98
+
Simply clone this repository and from the root of this repository run:
If you forgot the `recurse-submodules` flag, and you end up with errors that `weio` is missing, type the following:
71
-
```bash
72
-
git submodule update --init --recursive
73
-
```
74
-
75
-
###Running:
76
-
```bash
77
-
python viz3danim.py
78
-
```
79
-
80
-
Drag and drop files.
81
-
102
+
This should create a local web server and launch the local version of the web app into your browser.
103
+
If your browswer does not open automatically, open it, and navigate to `https://localhost:1337/`.
82
104
83
105
84
106
@@ -87,13 +109,11 @@ Drag and drop files.
87
109
88
110
## SubDyn modes visualization (legacy)
89
111
90
-
The latest version of SubDyn can generate the '.json' file with Craig-Bampton, Guyan and FEM mode shapes.
91
-
Simply drag and drop the `.json` files into the browser.
92
-
There is no need to follow the step below.
112
+
The latest version of SubDyn (part of [OpenFAST](https://github.com/openfast/openfast)) can generate the '.json' file with Craig-Bampton, Guyan and FEM mode shapes by setting the options `OutCBModes` and `OutFEMModes`, in the SubDyn input file (see [here](https://openfast.readthedocs.io/en/dev/source/user/subdyn/input_files.html#output-summary-and-outfile)). After running SubDyn, simply drag and drop the generated `.json` files into the browser. There is no need to follow the step below which are for older version of SubDyn.
93
113
94
-
### Generating a json file from a summary file:
114
+
### Generating a json file from a SubDyn summary file:
95
115
There are two steps for now:
96
-
1. Convert the yaml file to a "json" file, using a standalone python script called `subDynModeViz
116
+
1. Convert the yaml file to a "json" file, using a standalone python script called `subDynModeViz` located in the `legacy` folder`
97
117
2. Load the json file into the web-gui, which requires a web-server (more on that later).
98
118
We can make that 1 step in the future if needed.
99
119
@@ -105,22 +125,36 @@ The python script and web-app are located in this repository (i.e. [here](https:
105
125
### Step 1 (and 2):
106
126
- To generate a json file:
107
127
108
-
python subDynModeViz File.sum.yaml
128
+
python legacy/subDynModeViz File.sum.yaml
109
129
110
130
- To generate a json file, launch a web server and open the json file directly:
111
131
112
-
python subDynModeViz --open File.sum.yaml
132
+
python legacy/subDynModeViz --open File.sum.yaml
113
133
114
134
### Step 2 :
115
135
- Option 1: use the [internet demo version](https://ebranlard.github.io/viz3Danim/) and open the json file there
116
136
- Option 2: use the python script with `--open` flag to launch a local server
117
137
- Option 3: create your own local server and open the json file manually:
118
138
```bash
119
-
python -m http.server 8000 # launch a web server
120
-
# then open a browser and navigate to https://localhost:8000/
139
+
python legacy/subdynModeViz --open # launch a web server on port 1337
140
+
# then open a browser and navigate to https://localhost:1337/
121
141
```
122
142
123
-
### Current limitations:
124
-
- "json" format undocumented
125
143
126
144
145
+
146
+
# Debugging
147
+
148
+
Most browser can open a debugging console by pressing `Ctrl+Shift+J`. Error messages from javascript will be reported in the Console window, together with some log outputs from the app.
149
+
150
+
To force reload the webapp use `Ctrl-F5`, this will reload all the files included (otherwise cached versions are used).
151
+
152
+
153
+
154
+
# Contributing
155
+
Any contributions to this project are welcome! If you want to add a feature to this program or report a bug, the best approach would be to open an issue and start the discussion there.
156
+
157
+
158
+
If you find this project useful, you can also buy me a coffee (donate a small amount) with the link below:
159
+
160
+
<ahref="https://www.buymeacoffee.com/hTpOQGl"rel="nofollow"><imgalt="Donate just a small amount, buy me a coffee!"src="https://warehouse-camo.cmh1.psfhosted.org/1c939ba1227996b87bb03cf029c14821eab9ad91/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d4275792532306d6525323061253230636f666665652d79656c6c6f77677265656e2e737667"></a>
0 commit comments