Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6f76c5e
Allow using CairoMakie or GLMakie using the menu()
ufechner7 Apr 19, 2026
51b4203
Update News.md
ufechner7 Apr 19, 2026
245e39a
Update docu
ufechner7 Apr 19, 2026
b129ace
Use pdf as default if CairoMakie is active
ufechner7 Apr 19, 2026
a4fa28c
Add output directory
ufechner7 Apr 19, 2026
0e2af14
Save as pdf for CairoMakie
ufechner7 Apr 19, 2026
016be7a
Add folder to .gitignore
ufechner7 Apr 19, 2026
01ce01e
Spaces in title
ufechner7 Apr 19, 2026
fb44d6c
Add save logic
ufechner7 Apr 19, 2026
9c418ce
Billowing can save now pdf
ufechner7 Apr 19, 2026
2994e4b
Update pyramid_model.jl
ufechner7 Apr 19, 2026
0a44cff
Update ram_air_kite.jl
ufechner7 Apr 19, 2026
9ffda88
Update stall_model.jl
ufechner7 Apr 19, 2026
604579b
Update V3_kite.jl
ufechner7 Apr 19, 2026
f3934ad
Increase test coverage
ufechner7 Apr 19, 2026
2bb87b8
Update menu
ufechner7 Apr 19, 2026
815475b
Check if Cairo is activated, not loaded
ufechner7 Apr 19, 2026
b1b6748
Don't hardcode data type
ufechner7 Apr 19, 2026
c7cc6f1
Don't hardcode data_type
ufechner7 Apr 19, 2026
ae8d3b7
Don't hardcode the data type
ufechner7 Apr 19, 2026
fcbd71b
Update docstring
ufechner7 Apr 19, 2026
c9c0dba
Increase test coverage
ufechner7 Apr 19, 2026
6aa190f
Increase timeout to 60min
ufechner7 Apr 19, 2026
e2acd33
Increase timeout
ufechner7 Apr 19, 2026
8f19fd3
Next try
ufechner7 Apr 20, 2026
5d41ba4
Improve test
ufechner7 Apr 20, 2026
79e4909
Updated.
ufechner7 Apr 20, 2026
c556cf9
Removed this lighter statement
ufechner7 Apr 20, 2026
0b7bed6
One more change
ufechner7 Apr 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ data/ram_air_kite/ram_air_kite_foil_cl_polar.csv
.gitignore
data/ram_air_kite/ram_air_kite_foil_cd_polar.csv
data/ram_air_kite/ram_air_kite_foil_cm_polar.csv
output/
output_cairo/
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Unreleased

### Added
- allow using CairoMakie or GLMakie using the menu

## VortexStepMethod v3.1.0 2025-04-19

### Breaking
Expand Down
5 changes: 5 additions & 0 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ $_julia_cmd --project=examples -e 'using GLMakie, VortexStepMethod; @info "GLMak
$_julia_cmd -t1 --project=examples_cp -e 'using ControlPlots, VortexStepMethod; @info "ControlPlots extension ready."'
$_julia_cmd --project=. -e 'using Pkg; Pkg.test(test_args=["settings/test_settings.jl"]);
@info "Minimal test smoke check complete."'

echo
echo "Creating output directory..."
mkdir -p output

echo
echo "Installation complete."

53 changes: 52 additions & 1 deletion docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,55 @@ Choose function to execute or `q` to quit:
```

You can select one of the examples using the `<UP>` and `<DOWN>` keys.
Press `<ENTER>` to run the selected example.
Press `<ENTER>` to run the selected example.

## Plotting Backends

The examples in this package support three plotting backends. Here is a comparison to help you choose:

### GLMakie
Comment thread
ufechner7 marked this conversation as resolved.
**Advantages:**
- Interactive plots: zoom, pan, rotate 3D scenes in a native window.
- Hardware-accelerated rendering via OpenGL — fast for large datasets.
- Supports animations and live-updating plots.

**Disadvantages:**
- Requires a display server (does not work in headless/server environments without a virtual framebuffer).
- Heavier dependency: needs OpenGL drivers and a GPU.
- Longer initial load time compared to the other backends.

### CairoMakie
**Advantages:**
- Fully software-rendered — works in headless environments (CI, servers, SSH sessions).
- Produces high-quality vector output (SVG, PDF) suitable for publication.
Comment thread
ufechner7 marked this conversation as resolved.
Outdated
- Lighter dependency than GLMakie (no GPU required).
Comment thread
ufechner7 marked this conversation as resolved.
Outdated

**Disadvantages:**
- Plots are static — no interactive zoom or pan.
- Slower for very large or complex scenes because rendering is done in software.
- 3D support is limited compared to GLMakie.

### ControlPlots (based on PyPlot / Matplotlib)
**Advantages:**
- Simple API, easy to learn for students
- In addition, the Matplotlib API for users coming from Python/Matplotlib is supported.
- Works in headless environments; can save to PNG, SVG, PDF, etc.
- Very lightweight Julia-side dependency (delegates work to Python).

**Disadvantages:**
- Requires a working Python installation with Matplotlib (via `PyCall`).
- Can cause issues when multithreading is enabled.
Comment thread
ufechner7 marked this conversation as resolved.
Outdated
- No native Makie ecosystem integration (e.g. cannot use `Makie.Observable` for live updates).
- Interactivity is limited and depends on the Matplotlib backend in use.
- Extra setup complexity when Python or Matplotlib are not already installed.

| Feature | GLMakie | CairoMakie | ControlPlots |
|---|---|---|---|
| Interactive (zoom/pan) | yes | no | yes |
| Headless / server | no* | yes | yes |
| Vector output (PDF/SVG) | no | yes | yes |
| GPU required | yes | no | no |
| 3D support | full | limited | limited |
| Load time | slow | medium | fast |

\* GLMakie can run headless with a virtual framebuffer (e.g. `Xvfb`), but this requires additional setup.
1 change: 1 addition & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
Expand Down
24 changes: 14 additions & 10 deletions examples/V3_kite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ using LinearAlgebra
using VortexStepMethod

PLOT = true
SAVE_ALL = false
USE_TEX = false
DEFORM = false
OUTPUT_DIR = joinpath(dirname(@__DIR__), "output")

project_dir = dirname(@__DIR__)
literature_paths = [
Expand Down Expand Up @@ -118,8 +120,8 @@ PLOT && plot_polars(
side_slip=sideslip_deg,
v_a=wind_speed,
title="$(wing.n_panels)_panels_$(wing.spanwise_distribution)_from_yaml_settings",
data_type=".pdf",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX,
show_moments=true
Expand All @@ -128,10 +130,10 @@ PLOT && plot_polars(
# Plotting geometry
PLOT && plot_geometry(
body_aero,
"";
data_type=".svg",
save_path="",
is_save=false,
"V3 kite geometry";
data_type=".pdf",
Comment thread
ufechner7 marked this conversation as resolved.
Outdated
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
view_elevation=15,
view_azimuth=-120,
Expand All @@ -147,8 +149,8 @@ PLOT && plot_distribution(
[results],
["VSM"];
title="CAD_spanwise_distributions_alpha_$(round(angle_of_attack_deg, digits=1))_delta_$(round(sideslip_deg, digits=1))_yaw_$(round(yaw_rate, digits=1))_v_a_$(round(wind_speed, digits=1))",
data_type=".pdf",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand Down Expand Up @@ -193,7 +195,8 @@ PLOT && plot_polars(
v_a=wind_speed,
title="LOOP solver",
show_moments=true,
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand All @@ -211,7 +214,8 @@ PLOT && plot_polars(
v_a=wind_speed,
title="beta sweep",
show_moments=true,
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand Down
43 changes: 25 additions & 18 deletions examples/billowing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ using LinearAlgebra
using VortexStepMethod

PLOT = true
SAVE_ALL = false
USE_TEX = false
OUTPUT_DIR = joinpath(dirname(@__DIR__), "output")

# Data paths (all within this repo)
vsm_src_path = something(pathof(VortexStepMethod), @__FILE__)
Expand Down Expand Up @@ -132,28 +134,12 @@ println("Billowed: CL=$(round(results_bill["cl"]; digits=4)), " *
"CD=$(round(results_bill["cd"]; digits=4))")

if PLOT
# Plot polars comparison
plot_polars(
[solver_flat, solver_bill],
[body_aero_flat, body_aero_bill],
labels;
literature_path_list=literature_paths,
angle_range=range(-5, 25, length=31),
angle_type="angle_of_attack",
angle_of_attack=angle_of_attack_deg,
side_slip=sideslip_deg,
v_a=wind_speed,
title="V3 Kite: flat vs billowing $(BILLOWING_PCT)%",
is_show=true,
use_tex=USE_TEX,
show_moments=true
)

# Plot geometry (flat wing)
plot_geometry(
body_aero_flat,
"Flat wing geometry";
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand All @@ -168,9 +154,30 @@ if PLOT
[results_flat, results_bill],
["VSM flat", "VSM billowing"];
title="Billowing comparison distributions",
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)

# Plot polars comparison
plot_polars(
[solver_flat, solver_bill],
[body_aero_flat, body_aero_bill],
labels;
literature_path_list=literature_paths,
angle_range=range(-5, 25, length=31),
angle_type="angle_of_attack",
angle_of_attack=angle_of_attack_deg,
side_slip=sideslip_deg,
v_a=wind_speed,
title="V3 Kite flat vs billowing $(BILLOWING_PCT)%",
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX,
show_moments=true
)
end

nothing
5 changes: 4 additions & 1 deletion examples/menu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ using Pkg
Pkg.activate(@__DIR__)

using GLMakie
using CairoMakie
using VortexStepMethod
using REPL.TerminalMenus

Expand Down Expand Up @@ -43,12 +44,14 @@ end
function example_menu()
options = [
[("$( splitext(f)[1]) = include(\"$f\")") for f in example_files];
"GLMakie.activate!()";
"CairoMakie.activate!()";
"help_me = VortexStepMethod.help(\"$url\")";
"quit"
]
active = true
while active
menu = RadioMenu(options, pagesize=8)
menu = RadioMenu(options, pagesize=11)
choice = request(
"\nChoose function to execute or `q` to quit: ",
menu)
Expand Down
17 changes: 9 additions & 8 deletions examples/pyramid_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ results = VortexStepMethod.solve(solver, body_aero; log=true)

# Using plotting modules, to create more comprehensive plots
PLOT = true
SAVE_ALL = false
USE_TEX = false
OUTPUT_DIR = joinpath(dirname(@__DIR__), "output")

# Plotting polars
PLOT && plot_polars(
Expand All @@ -37,19 +39,18 @@ PLOT && plot_polars(
side_slip=sideslip_deg,
v_a=wind_speed,
title="$(wing.n_panels)_panels_$(wing.spanwise_distribution)_pyramid_model",
data_type=".pdf",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)

# Plotting geometry
PLOT && plot_geometry(
body_aero,
"";
data_type=".svg",
save_path="",
is_save=false,
"Pyramid model geometry";
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
view_elevation=15,
view_azimuth=-120,
Expand All @@ -64,8 +65,8 @@ PLOT && plot_distribution(
[results],
["VSM"];
title="pyramid_spanwise_distributions_alpha_$(round(angle_of_attack_deg, digits=1))_delta_$(round(sideslip_deg, digits=1))_yaw_$(round(yaw_rate, digits=1))_v_a_$(round(wind_speed, digits=1))",
data_type=".pdf",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand Down
18 changes: 10 additions & 8 deletions examples/ram_air_kite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ using LinearAlgebra

PLOT = true
PRN = true
SAVE_ALL = false
USE_TEX = false
DEFORM = true
LINEARIZE = false
OUTPUT_DIR = joinpath(dirname(@__DIR__), "output")

# Create wing geometry
wing = ObjWing(
Expand Down Expand Up @@ -74,10 +76,10 @@ PLOT && plot_polar_data(body_aero)
# Plotting geometry
PLOT && plot_geometry(
body_aero,
"";
data_type=".svg",
save_path="",
is_save=false,
"Ram air kite geometry";
data_type=".pdf",
Comment thread
ufechner7 marked this conversation as resolved.
Outdated
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
view_elevation=15,
view_azimuth=-120,
Expand All @@ -96,8 +98,8 @@ PLOT && plot_distribution(
[results],
["VSM"];
title="CAD_spanwise_distributions_alpha_$(round(aoa, digits=1))_delta_$(round(side_slip, digits=1))_yaw_$(round(yaw_rate, digits=1))_v_a_$(round(v_a, digits=1))",
data_type=".pdf",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand All @@ -114,8 +116,8 @@ PLOT && plot_polars(
side_slip=0,
v_a=10,
title="ram_kite_panels_$(wing.n_panels)_distribution_$(wing.spanwise_distribution)",
data_type=".pdf",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand Down
12 changes: 9 additions & 3 deletions examples/rectangular_wing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ using LinearAlgebra
using VortexStepMethod

PLOT = true
SAVE_ALL = false
USE_TEX = false
OUTPUT_DIR = joinpath(dirname(@__DIR__), "output")

# Step 1: Define wing parameters
n_panels = 20 # Number of panels
Expand Down Expand Up @@ -58,10 +60,10 @@ println("Projected area = $(round(results_vsm["projected_area"], digits=4)) m²"
# Step 6: Plot geometry
PLOT && plot_geometry(
body_aero,
"Rectangular_wing_geometry";
"Rectangular wing geometry";
data_type=".pdf",
Comment thread
ufechner7 marked this conversation as resolved.
Outdated
save_path=".",
is_save=false,
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
is_show=true,
use_tex=USE_TEX
)
Expand All @@ -74,6 +76,8 @@ PLOT && plot_distribution(
[results_vsm, results_llt],
["VSM", "LLT"],
title="Spanwise Distributions",
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
use_tex=USE_TEX
)

Expand All @@ -87,6 +91,8 @@ PLOT && plot_polars(
angle_type="angle_of_attack",
v_a,
title="Rectangular Wing Polars",
save_path=OUTPUT_DIR,
is_save=false || SAVE_ALL,
use_tex=USE_TEX
)
nothing
Loading
Loading