Skip to content

Commit 3f6c1b9

Browse files
committed
Fix plotting 3d polars
1 parent a44ed7d commit 3f6c1b9

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

bin/run_julia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ done
1919
if [[ $# -gt 0 ]]; then
2020
JULIA_ARGS=("$@")
2121
else
22-
JULIA_ARGS=(-i -e 'using VortexStepMethod; function menu(); include("examples/menu.jl"); end; function menu_cp(); include("examples_cp/menu_cp.jl"); end')
22+
JULIA_ARGS=()
2323
fi
2424

2525
julia --project "${JULIA_ARGS[@]}"

ext/VortexStepMethodControlPlotsExt.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,9 @@ function VortexStepMethod.plot_polar_data(body_aero::BodyAerodynamics,
793793
ax = fig.add_subplot(1, 3, idx, projection="3d")
794794

795795
# Create interpolation matrix
796-
interp_matrix = zeros(length(alphas), length(delta_tes))
797-
interp_matrix .= [interp(alpha, delta_te) for alpha in alphas, delta_te in delta_tes]
796+
interp_matrix = zeros(length(delta_tes), length(alphas))
797+
interp_matrix .= [interp(alpha, delta_te)
798+
for delta_te in delta_tes, alpha in alphas]
798799
X = collect(delta_tes) .+ zeros(length(alphas))'
799800
Y = collect(alphas)' .+ zeros(length(delta_tes))
800801

ext/VortexStepMethodMakieExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ function VortexStepMethod.plot_polar_data(body_aero::BodyAerodynamics,
920920

921921
# Create interpolation matrix
922922
interp_matrix = [interp(alpha, delta_te)
923-
for alpha in alphas, delta_te in delta_tes]
923+
for delta_te in delta_tes, alpha in alphas]
924924

925925
# Create wireframe
926926
wireframe!(ax, delta_tes, alphas, interp_matrix;

test/plotting/test_plotting.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,16 @@ end
245245
@test fig !== nothing
246246
end
247247

248+
fig_rect = plot_polar_data(body_aero;
249+
alphas=collect(deg2rad.(-5:1.0:15)),
250+
delta_tes=collect(deg2rad.(-3:1.0:5)),
251+
is_show=false)
252+
if backend == "Makie"
253+
@test fig_rect isa Figure
254+
else
255+
@test fig_rect !== nothing
256+
end
257+
248258
# Tests for both backends
249259
body_aero_empty = create_body_aero()
250260
empty!(body_aero_empty.panels)

0 commit comments

Comments
 (0)