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
@usingModiaPlot# use the plot package defined by ENV["MODIA_PLOT"]
29
29
plot(pendulum, "rev.phi")
30
+
30
31
end
31
32
```
32
33
or
@@ -46,16 +47,16 @@ The commands above generate an instance of the model, simulate it and generate t
46
47
47
48
## 2. Pendulum with Animation
48
49
49
-
The Object3Ds of the first example are extended with [Visual](@ref) and [Solid](@ref) features in order that the pendulum parts are visualized and exported for offline animation by defining `animationFile = "Pendulum2.json"` in [Scene](@ref). The first Object3D `obj1` is defined as a solid [Box](@ref) with `"Blue"`color and its [Solid material](@ref) is made of `"Steel"`. Mass, center of mass and inertia tensor are computed from Steel density and from the [Box](@ref) shape. The second Object3D `obj2` is a visual red [Cylinder](@ref) that is used to visualize the axis of the revolute joint. Please, see example: `$(Modia3D.path)/test/Tutorial/Pendulum2.jl`
50
+
The Object3Ds of the first example are extended with [Visual](@ref) and [Solid](@ref) features in order that the pendulum parts are visualized and exported for offline animation by defining `animationFile = "Pendulum2.json"` in [Scene](@ref). The first Object3D `obj1` is defined as a solid [Beam](@ref) with `"Blue"`color and its [Solid material](@ref) is made of `"Steel"`. Mass, center of mass and inertia tensor are computed from Steel density and from the [Beam](@ref) shape. The second Object3D `obj2` is a visual red [Cylinder](@ref) that is used to visualize the axis of the revolute joint. Please, see example: `$(Modia3D.path)/test/Tutorial/Pendulum2.jl`
50
51
51
52
```julia
52
53
module Pendulum2
53
54
54
-
usingModia
55
+
using Modia
55
56
56
57
Pendulum =Model(
57
58
world =Object3D(feature=Scene(animationFile="Pendulum2.json")),
Open [https://threejs.org/editor/](https://threejs.org/editor/), import the json file (File --> Import) and inspect the model in threejs:
80
+
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:
View the simulation animation by clicking the Play button in the Object tab.
82
85
83
-
Export the animation in glb format (File --> Export GLB) and use an glb/glTF-viewer to inspect the animation (for example the 3D-Viewer of Windows 10).
84
-
86
+
Export the animation in glb format (File --> Export GLB) to view it in a glb/[glTF](https://www.khronos.org/gltf/) viewer (for example the 3D-Viewer of Windows 10).
85
87
86
88
87
89
## 3. Pendulum with Modia equations
@@ -91,14 +93,14 @@ The pendulum model from the previous section is extended with a damper that is d
91
93
```julia
92
94
module Pendulum3
93
95
94
-
usingModia
96
+
using Modia
95
97
96
98
# Modia equation-based models
97
99
include("$(Modia.modelsPath)/AllModels.jl")
98
100
99
101
Pendulum =Model(
100
102
world =Object3D(feature=Scene(animationFile="Pendulum3.json")),
0 commit comments