Skip to content

Commit 282ed39

Browse files
committed
Return plots
1 parent 86f0857 commit 282ed39

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ext/VortexStepMethodMakieExt.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ The corner points are ordered as: LE1, TE1, TE2, LE2.
99
This creates two triangles: (LE1, TE1, TE2) and (LE1, TE2, LE2).
1010
"""
1111
function Makie.plot!(ax, panel::VortexStepMethod.Panel; color=(:red, 0.2), R_b_w=nothing, T_b_w=nothing, kwargs...)
12+
plots = []
1213
points = [Point3f(panel.corner_points[:, i]) for i in 1:4]
1314
if !isnothing(R_b_w) && !isnothing(T_b_w)
1415
points = [Point3f(R_b_w * p + T_b_w) for p in points]
1516
end
1617
faces = [Makie.GLTriangleFace(1, 2, 3), Makie.GLTriangleFace(1, 3, 4)]
17-
mesh!(ax, points, faces; color, kwargs...)
18+
p = mesh!(ax, points, faces; color, kwargs...)
19+
push!(plots, p)
1820
border_points = [points..., points[1]]
19-
lines!(ax, border_points; color=:black)
21+
p = lines!(ax, border_points; color=:black)
22+
push!(plots, p)
23+
return plots
2024
end
2125

2226
"""
@@ -25,9 +29,12 @@ end
2529
Plot a `BodyAerodynamics` object by plotting each of its panels.
2630
"""
2731
function Makie.plot!(ax, body::VortexStepMethod.BodyAerodynamics; color=(:red, 0.2), R_b_w=nothing, T_b_w=nothing, kwargs...)
32+
plots = []
2833
for panel in body.panels
29-
Makie.plot!(ax, panel; color, R_b_w, T_b_w, kwargs...)
34+
p = Makie.plot!(ax, panel; color, R_b_w, T_b_w, kwargs...)
35+
push!(plots, p)
3036
end
37+
return plots
3138
end
3239

3340
function Makie.plot(panel::VortexStepMethod.Panel; size = (1200, 800), kwargs...)

0 commit comments

Comments
 (0)