Skip to content

Commit 3d12cab

Browse files
authored
switch rendering backend to GLMakie (#86)
* switch rendering backend to WGLMakie * try something * try GLMakie instead * rm sudo * rm apt install this is done permanently on the CI machine * add DISPLAY env * string * more display * up example
1 parent 4a13a9c commit 3d12cab

18 files changed

+89
-86
lines changed

.github/workflows/Documentation.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ jobs:
3232
private_registry_name: JuliaSimRegistry
3333
private_registry_uuid: 309a7822-a73e-4490-9504-7d1983f27685
3434
- name: Install dependencies
35-
run: julia --project=docs -e 'using Pkg;
35+
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs -e 'using Pkg;
36+
ENV["DISPLAY"] = "0";
3637
Pkg.setprotocol!(; domain = "github.com", protocol = "ssh");
3738
Pkg.add(PackageSpec(name = "JuliaSimCompiler", url = "https://github.com/JuliaComputing/JuliaSimCompiler.jl", rev = "master"));
3839
Pkg.develop(PackageSpec(path=pwd()));
3940
Pkg.instantiate()'
4041
- name: Build and deploy
4142
env:
4243
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
43-
run: julia --project=docs/ docs/make.jl
44+
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ docs/make.jl

docs/Manifest.toml

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[deps]
2-
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
32
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
44
JuliaSimCompiler = "8391cb6b-4921-5777-4e45-fd9aab8cb88d"
55
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
66
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"

docs/make.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Multibody
22
using Documenter
3-
using CairoMakie
3+
using GLMakie
4+
GLMakie.activate!()
5+
46
ENV["JULIA_DEBUG"]=Documenter # Enable this for debugging
57
ENV["DOCS_BUILD"] = true # used to lower the default frame rate in animations for the docs
68

docs/src/examples/free_motion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ plot(sol, idxs = [body.r_0...])
9393
```
9494

9595
```@example FREE_MOTION
96-
import CairoMakie
96+
import GLMakie
9797
Multibody.render(model, sol, filename = "free_body.gif")
9898
nothing # hide
9999
```

docs/src/examples/gyroscopic_effects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ using Test # hide
4848
@test sol(5, idxs=collect(model.body2.r_0[1:3])) ≈ [-0.0357364, -0.188245, 0.02076935] atol=1e-3 # hide
4949
# plot(sol, idxs=collect(model.body2.r_0)) # hide
5050
51-
import CairoMakie
51+
import GLMakie
5252
Multibody.render(model, sol; x=1, z=1, filename = "gyro.gif") # Use "gyro.mp4" for a video file
5353
nothing # hide
5454
```

docs/src/examples/kinematic_loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ using Test
7979
Multibody.jl supports automatic 3D rendering of mechanisms, we use this feature to illustrate the result of the simulation below:
8080

8181
```@example kinloop
82-
import CairoMakie
82+
import GLMakie
8383
Multibody.render(fourbar, sol, 0:0.05:10; x=4, y=-1, z=4, lookat=[0, -1, 0], filename = "fourbar.gif") # Use "fourbar.mp4" for a video file
8484
nothing # hide
8585
```
@@ -136,7 +136,7 @@ plot(sol, idxs=[j2.s]) # Plot the joint coordinate of the prismatic joint (green
136136
```
137137

138138
```@example kinloop
139-
import CairoMakie
139+
import GLMakie
140140
Multibody.render(fourbar2, sol; x=-2, y = 2, z = 3, filename = "fourbar2.gif") # Use "fourbar2.mp4" for a video file
141141
nothing # hide
142142
```

docs/src/examples/pendulum.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The solution `sol` can be plotted directly if the Plots package is loaded. The f
6767
Multibody.jl supports automatic 3D rendering of mechanisms, we use this feature to illustrate the result of the simulation below:
6868

6969
```@example pendulum
70-
import CairoMakie # GLMakie is another alternative, suitable for interactive plots
70+
import GLMakie # GLMakie is another alternative, suitable for interactive plots
7171
Multibody.render(model, sol; filename = "pendulum.gif") # Use "pendulum.mp4" for a video file
7272
nothing # hide
7373
```
@@ -226,7 +226,7 @@ plot(sol, layout=4)
226226
```
227227

228228
```@example pendulum
229-
import CairoMakie
229+
import GLMakie
230230
Multibody.render(model, sol, filename = "furuta.gif")
231231
nothing # hide
232232
```

docs/src/examples/robot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ plot(sol, idxs = [
9797
Multibody.jl supports automatic 3D rendering of mechanisms, we use this feature to illustrate the result of the simulation below:
9898

9999
```@example robot
100-
import CairoMakie
100+
import GLMakie
101101
Multibody.render(robot, sol; y=2, lookat=[0,1,0], filename = "robot.gif")
102102
nothing # hide
103103
```

docs/src/examples/ropes_and_cables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ prob = ODEProblem(ssys, [], (0, 5))
3535
sol = solve(prob, Rodas4(autodiff=false))
3636
@test SciMLBase.successful_retcode(sol)
3737
38-
import CairoMakie
38+
import GLMakie
3939
Multibody.render(stiff_rope, sol, filename = "stiff_rope.gif") # May take long time for n>=10
4040
```
4141
![stiff_rope animation](stiff_rope.gif)

0 commit comments

Comments
 (0)