Skip to content

Commit 05192b7

Browse files
Merge pull request #33 from ModiaSim/an_docu_installationGuide
An docu installation guide
2 parents e1b9d8d + 8801ea3 commit 05192b7

File tree

5 files changed

+74
-41
lines changed

5 files changed

+74
-41
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example videos:
1616

1717
## Installation
1818

19-
Modia3D is included in [Modia](https://github.com/ModiaSim/Modia.jl) and is available, when Modia was installed.
19+
Modia3D is included in [Modia](https://github.com/ModiaSim/Modia.jl) and is available, when Modia was installed. Please, follow the [extensive installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia) or the [lightweight installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Lightweight-Installation-Guide:-Julia-Modia3D) for Modia3D.
2020

2121
A standalone Modia3D version is installed with
2222

@@ -26,12 +26,12 @@ julia> ]add ModiaLang, Modia3D
2626

2727
Modia3D animation can be exported in [three.js JSON Object Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4) and then imported in the open source web app [three.js editor](https://threejs.org/editor/) and use all the features of three.js, for example to export in the widely used glb format (the binary version of the [glTF](https://www.khronos.org/gltf/) format) and use any glb viewer (for example 3D-Viewer of Windows 10).
2828

29-
Additionally, the (free) community or the (commercial) professional version of the [DLR Visualization](http://www.systemcontrolinnovationlab.de/the-dlr-visualization-library/) library is supported that provides online animation (during simulation) and generation of mpg4-videos. To install the free version for *Windows* or for *Linux* perform the following steps:
29+
Additionally, Modia3D uses the (free) community or the (commercial) professional version of the [DLR Visualization Library](https://visualization.ltx.de/) for 3D simulations. It provides online animation (during simulation) and the generation of mpg4-videos. If you don't use the DLR Visualization Library result animation is switched of.
30+
Download and install the free DLR SimVis Community Edition, e.g. with [https://visualization.ltx.de/](https://visualization.ltx.de/) .
3031

31-
1. Go to [https://visualization.ltx.de/](https://visualization.ltx.de/), provide your contact information and click on *Request download* for *Community Edition*. Afterwards, you get a link to download the library and you need to unzip the file.
32-
2. In your Julia **startup file** (`HOME/.julia/config/startup.jl`) include the environment variable `ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"`. Make sure that the SimVis executable under this directory has execution rights. For example in Linux with command:`chmod ug+x <path-to-library>/Visualization/Extras/SimVis/linux/SimVis`
33-
3. Start Julia and run one of the tests, for example\
34-
`include("$(Modia3D.path)/test/Basic/PendulumWithBar1.jl")`
32+
* Set an environment variable or add it to the [startup.jl file](https://github.com/ModiaSim/Modia3D.jl/wiki/Template-for-startup.jl). Please, read also the [installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia).
33+
* `ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"`
34+
* Make sure that the SimVis executable under this directory has execution rights. For example in Linux with command: `chmod ug+x <path-to-library>/Visualization/Extras/SimVis/linux/SimVis`
3535

3636

3737
## Main Developers and License

docs/src/index.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Example videos:
1313

1414
## Installation
1515

16-
Modia3D is included in [Modia](https://github.com/ModiaSim/Modia.jl) and is available, when Modia was installed.
16+
Modia3D is included in [Modia](https://github.com/ModiaSim/Modia.jl) and is available, when Modia was installed. Please, follow the [extensive installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia) or the [lightweight installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Lightweight-Installation-Guide:-Julia-Modia3D) for Modia3D.
1717

1818
A standalone Modia3D version is installed with
1919

@@ -23,12 +23,12 @@ julia> ]add ModiaLang, Modia3D
2323

2424
Modia3D animation can be exported in threejs-json-format and then imported in the open source web app [threejs.org](https://threejs.org/editor/) and use all the features of threejs, for example to export in the widely used glb format (= the binary version of the [glTF](https://www.khronos.org/gltf/) format) and use any glb-viewer (for example 3D-Viewer of Windows 10).
2525

26-
Additionally, the (free) community or the (commercial) professional version of the [DLR Visualization](http://www.systemcontrolinnovationlab.de/the-dlr-visualization-library/) library is supported that provides online animation (during simulation) and generation of mpg4-videos. To install the free version for *Windows* or for *Linux* perform the following steps:
26+
Additionally, Modia3D uses the (free) community or the (commercial) professional version of the [DLR Visualization Library](https://visualization.ltx.de/) for 3D simulations. It provides online animation (during simulation) and the generation of mpg4-videos. If you don't use the DLR Visualization Library result animation is switched of.
27+
Download and install the free DLR SimVis Community Edition, e.g. with [https://visualization.ltx.de/](https://visualization.ltx.de/) .
2728

28-
1. Go to [https://visualization.ltx.de/](https://visualization.ltx.de/), provide your contact information and click on *Request download* for *Community Edition*. Afterwards, you get a link to download the library and you need to unzip the file.
29-
2. In your Julia **startup file** (`HOME/.julia/config/startup.jl`) include the environment variable `ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"`. Make sure that the SimVis executable under this directory has execution rights. For example in Linux with command:`chmod ug+x <path-to-library>/Visualization/Extras/SimVis/linux/SimVis`
30-
3. Start Julia and run one of the tests, for example\
31-
`include("$(Modia3D.path)/test/Basic/PendulumWithBar1.jl")`
29+
* Set an environment variable or add it to the [startup.jl file](https://github.com/ModiaSim/Modia3D.jl/wiki/Template-for-startup.jl). Please, read also the [installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia).
30+
* `ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"`
31+
* Make sure that the SimVis executable under this directory has execution rights. For example in Linux with command: `chmod ug+x <path-to-library>/Visualization/Extras/SimVis/linux/SimVis`
3232

3333

3434
## Release Notes
@@ -49,9 +49,11 @@ Additionally, the (free) community or the (commercial) professional version of t
4949
| [3] |*[Algorithms for Component-Based 3D Modeling](http://www.ep.liu.se/ecp/157/039/ecp19157039.pdf)*|[13th International Modelica Conference 2019, March](https://modelica.org/events/modelica2019)|[10.3384/ecp19157383](https://doi.org/10.3384/ecp19157383)|
5050
| [4a] |*[Modia3D: Modeling and Simulation of 3D-Systems in Julia](https://proceedings.juliacon.org/papers/10.21105/jcon.00043)*|[JuliaCon 2019, July](https://juliacon.org/2019/)|[10.21105/jcon.00043](https://doi.org/10.21105/jcon.00043)|
5151
| [4b] |*[Modia3D: Modeling and Simulation of 3D-Systems in Julia](https://proceedings.juliacon.org/papers/10.21105/jcon.00043)*|[JuliaCon 2019, July](https://juliacon.org/2019/)|[YouTube](https://www.youtube.com/watch?v=b3WfqXZRKpA)|
52-
| [5] |*Collision Handling with Elastic Response Calculation and Zero-Crossing Functions*|[EOOLT 2019, November](http://www.eoolt.org/2019/)|[10.1145/3365984.3365986](https://doi.org/10.1145/3365984.3365986)|
53-
| [6] |*Modia – Modeling Multidomain Engineering Systems with Julia*|[JuliaCon 2021, July](https://juliacon.org/2021/)|[YouTube](https://www.youtube.com/watch?v=N94si3rOl1g)|
54-
| [7] |*Modia – Equation Based Modeling and Domain Specific Algorithms*|[14th International Modelica Conference 2021, September](http://www.modelica.org/)|accepted for publication|
52+
| [5] |*[Collision Handling with Elastic Response Calculation and Zero-Crossing Functions](https://doi.org/10.1145/3365984.3365986)*|[EOOLT 2019, November](http://www.eoolt.org/2019/)|[10.1145/3365984.3365986](https://doi.org/10.1145/3365984.3365986)|
53+
| [6] |*[Modia – Modeling Multidomain Engineering Systems with Julia](https://www.youtube.com/watch?v=N94si3rOl1g)*|[JuliaCon 2021, July](https://juliacon.org/2021/)|[YouTube](https://www.youtube.com/watch?v=N94si3rOl1g)|
54+
| [7a] |*[Modia – Equation Based Modeling and Domain Specific Algorithms](https://doi.org/10.3384/ecp2118173)*|[14th International Modelica Conference 2021, September](http://www.modelica.org/)| [10.3384/ecp2118173](https://doi.org/10.3384/ecp2118173) |
55+
| [7b] |*[Modia – Equation Based Modeling and Domain Specific Algorithms](https://doi.org/10.3384/ecp2118173)*|[14th International Modelica Conference 2021, September](http://www.modelica.org/)| YouTube comming soon |
56+
5557

5658

5759

docs/src/tutorial/CollisionHandling.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ plot(bouncingSphere, "free.r", figure=1)
3636
3737
end
3838
```
39+
or
40+
```julia
41+
julia> import Modia3D
42+
julia> include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
43+
```
44+
3945
The commands above generate an instance of the model, simulate it and generate the following plot:
4046

4147
![Tutorial-Collision](../../resources/images/Tutorial/bouncingSphere.png)

docs/src/tutorial/GettingStarted.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ An [Object3D](@ref) constructor is the core element of Modia3D. It defines a coo
88

99
## 1. Pendulum
1010

11-
In the following example a simple pendulum is defined. This example is a copy of: `$(Modia3D.path)/test/Tutorial/Pendulum1.jl`
11+
In the following example a simple pendulum is defined. This example is a copy of: `$(Modia3D.path)/test/Tutorial/Pendulum1.jl`. [Here](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia#running-julia-code-with-vs-codiumvs-code) is a short description of how to execute a Julia file in VS Code,
1212

1313
```julia
1414
module Pendulum1
@@ -30,10 +30,10 @@ plot(pendulum, "rev.phi")
3030

3131
end
3232
```
33-
or
33+
or execute it in the Julia `REPL`
3434
```julia
35-
import Modia3D
36-
include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
35+
julia> import Modia3D # is only required for '$(Modia3D.path)' in the include command
36+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
3737
```
3838

3939
The `world` [Object3D](@ref) has feature [Scene](@ref) and is therefore the inertial system. The `body` Object3D is a [Solid](@ref) and defines the pendulum as a mass point with `mass = 1.0`. The `bodyFrame` Object3D defines a coordinate system on the `body` that is translated along the x-axis. A revolute joint connects `world` with `bodyFrame`.
@@ -73,8 +73,8 @@ end
7373
```
7474
or
7575
```julia
76-
import Modia3D
77-
include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
76+
julia> import Modia3D
77+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
7878
```
7979

8080
Open the [three.js editor](https://threejs.org/editor/), import (File --> Import) the [json file](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4) `Pendulum2.json` in your working directory and inspect the model:
@@ -122,8 +122,8 @@ end
122122
```
123123
or
124124
```julia
125-
import Modia3D
126-
include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
125+
julia> import Modia3D
126+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
127127
```
128128

129129
The commands above generate an instance of the model, simulate it and generate the following plot:
@@ -136,20 +136,21 @@ The commands above generate an instance of the model, simulate it and generate t
136136
All examples of this tutorial are stored in `$(Modia3D.path)/test/Tutorial`.
137137

138138
```julia
139-
include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
140-
include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
141-
include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
142-
include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
139+
julia> import Modia3D
140+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
141+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
142+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
143+
julia> include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
143144
```
144145

145146
To run all tests without graphics, execute:
146147

147148
```julia
148-
include("$(Modia3D.path)/test/runtests.jl")
149+
julia> include("$(Modia3D.path)/test/runtests.jl")
149150
```
150151

151152
To run all tests with visualization and plots, execute:
152153

153154
```julia
154-
include("$(Modia3D.path)/test/runtestsWithGraphics.jl")
155+
julia> include("$(Modia3D.path)/test/runtestsWithGraphics.jl")
155156
```

docs/src/tutorial/Tutorial.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,39 @@
22

33
This tutorial sketches the main features of Modia3D with examples. A detailed description is available in Modia3D Components.
44

5-
!!! info
6-
Modia has an interface to various plot packages. A plot package can be
7-
either selected by setting `ENV["MODIA_PLOT"] = XXX`, for example in the `config/startup.jl`
8-
file of Julia or by command `Modia.usePlotPackage(XXX)`.
9-
All examples assume that a plot package is defined.
10-
Possible values for `XXX`:
11-
- "[PyPlot](https://github.com/JuliaPy/PyPlot.jl)" (plots with Matplotlib from Python),
12-
- "[GLMakie](https://github.com/JuliaPlots/GLMakie.jl)" (interactive plots in an OpenGL window),
13-
- "[WGLMakie](https://github.com/JuliaPlots/WGLMakie.jl)" (interactive plots in a browser window),
14-
- "[CairoMakie](https://github.com/JuliaPlots/CairoMakie.jl)" (static plots on file with publication quality),
15-
- "NoPlot" (= all `plot(...)` calls are ignored), or
16-
- "SilentNoPlot" (= NoPlot without messages).
5+
## Plotting
6+
7+
Modia offers an interface to various plot packages. Please, read also the [installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia). Valid options are:
8+
9+
| Environment option | Modia package | Description |
10+
|:---|:--------------|:---|
11+
|"[GLMakie](https://github.com/JuliaPlots/GLMakie.jl)"| [ModiaPlot_GLMakie](https://github.com/ModiaSim/ModiaPlot_GLMakie.jl) | interactive plots in an OpenGL window |
12+
|"[WGLMakie](https://github.com/JuliaPlots/WGLMakie.jl)"| [ModiaPlot_WGLMakie](https://github.com/ModiaSim/ModiaPlot_WGLMakie.jl) | interactive plots in a browser window |
13+
|"[CairoMakie](https://github.com/JuliaPlots/CairoMakie.jl)"| [ModiaPlot_CairoMakie](https://github.com/ModiaSim/ModiaPlot_CairoMakie.jl) | static plots on file with publication quality |
14+
|"[PyPlot](https://github.com/JuliaPy/PyPlot.jl)"| [ModiaPlot_PyPlot](https://github.com/ModiaSim/ModiaPlot_PyPlot.jl) | plots with Matplotlib from Python |
15+
|"NoPlot"| | all `plot(...)` calls are ignored |
16+
|"SilentNoPlot"| | like "NoPlot" without messages |
17+
18+
First, you need to add the corresponding Modia package, e.g.
19+
```julia
20+
julia> ] add ModiaPlot_GLMakie
21+
```
22+
A plot package can be either selected by setting `ENV["MODIA_PLOT"] = "GLMakie"`, in the [startup.jl file](https://github.com/ModiaSim/Modia3D.jl/wiki/Template-for-startup.jl) of Julia or with command `Modia.usePlotPackage("GLMakie")`.
23+
24+
25+
## 3D Renderer
26+
27+
### Three.js
28+
29+
Modia3D animation can be exported in threejs-json-format and then imported in the open source web app [threejs.org](https://threejs.org/editor/) and use all the features of threejs, for example to export in the widely used glb format (= the binary version of the [glTF](https://www.khronos.org/gltf/) format) and use any glb-viewer (for example 3D-Viewer of Windows 10).
30+
31+
Objects are visualized and exported for offline animation by defining `animationFile = "Pendulum2.json"` in [Scene](@ref), see [2. Pendulum with Animation](@ref).
32+
33+
### The DLR Visualization Library
34+
35+
Modia3D uses the (free) community or the (commercial) professional version of the [DLR Visualization Library](https://visualization.ltx.de/) for 3D simulations. It provides online animation (during simulation) and the generation of mpg4-videos. If you don't use the DLR Visualization Library result animation is switched of.
36+
Download and install the free DLR SimVis Community Edition, e.g. with [https://visualization.ltx.de/](https://visualization.ltx.de/) .
37+
38+
* Set an environment variable or add it to the [startup.jl file](https://github.com/ModiaSim/Modia3D.jl/wiki/Template-for-startup.jl). Please, read also the [installation guide](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia).
39+
* `ENV["DLR_VISUALIZATION"] = "<path-to-library>/Visualization/Extras/SimVis"`
40+
* Make sure that the SimVis executable under this directory has execution rights. For example in Linux with command: `chmod ug+x <path-to-library>/Visualization/Extras/SimVis/linux/SimVis`

0 commit comments

Comments
 (0)