diff --git a/CHANGELOG.md b/CHANGELOG.md index ad34f57a..918a1f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## Unreleased + +### Fixed + +- `plot_slices_3d` on a generated output directory draws the deflected contour for + every deflection that was generated, not just positive whole degrees. It built its + own `_d.dat` filename tag instead of the `delta_suffix` one the files were + written under, which spells a minus sign `m` and a decimal point `p`, so + `delta=-10` or `delta=2.5` found no `.dat` and drew nothing. + ## VortexStepMethod v5.1.0 2026-09-11 ### Added diff --git a/ext/VortexStepMethodMakieExt.jl b/ext/VortexStepMethodMakieExt.jl index 3a9e77fc..5f025b3b 100644 --- a/ext/VortexStepMethodMakieExt.jl +++ b/ext/VortexStepMethodMakieExt.jl @@ -1601,8 +1601,7 @@ their written `.dat` airfoils — raw slice, wrap, and the `delta`-degree deform when it was generated — assembled for [`plot_slices_3d`](@ref VortexStepMethod.ObjAdapter.plot_slices_3d). Nothing is re-sliced or re-wrapped; only the Kulfan fits of the stored coordinates are -recomputed (via -`fit_pts`), exactly as the polar pipeline fits them. +recomputed (via `fit_pts`), exactly as the polar pipeline fits them. """ function generated_slices(out_dir, delta, fit_pts) geom = VortexStepMethod.YAML.load_file(joinpath(out_dir, "geometry.yaml")) @@ -1611,8 +1610,7 @@ function generated_slices(out_dir, delta, fit_pts) les = [Float64.(r[2:4]) for r in rows] tes = [Float64.(r[5:7]) for r in rows] n = length(rows) - deg = round(float(delta); digits=1) - tag = "_d" * (deg == round(deg) ? string(Int(deg)) : string(deg)) * ".dat" + tag = "_$(AirfoilAero.delta_suffix(deg2rad(delta))).dat" skipped_deltas = String[] slices = map(1:n) do i id = rows[i][1] @@ -1630,7 +1628,7 @@ function generated_slices(out_dir, delta, fit_pts) xd, yd = found ? AirfoilAero.read_dat_coordinates(dpath) : (Float64[], Float64[]) if isempty(xd) - push!(skipped_deltas, basename(dpath) * + push!(skipped_deltas, relpath(dpath, out_dir) * (found ? ": no finite coordinates" : ": no such file")) else def3d = map_airfoil_3d(les[i], tes[i], tangent, xd, yd) @@ -1642,9 +1640,8 @@ function generated_slices(out_dir, delta, fit_pts) wrap3d=map_airfoil_3d(les[i], tes[i], tangent, xw, yw), def3d, d2) end isempty(skipped_deltas) || - @warn "Skipping the delta=$(delta)° overlay for" * - " $(join(skipped_deltas, ", ")); generated deflections are named" * - " airfoils/_d.dat, and a blank one is a deflection the 2D" * + @warn "Skipping the delta=$(delta)° overlay in $out_dir for" * + " $(join(skipped_deltas, ", ")); a blank one is a deflection the 2D" * " solver converged at no angle." return slices, reduce(hcat, les), reduce(hcat, tes) end diff --git a/test/plotting/test_plotting.jl b/test/plotting/test_plotting.jl index 536549c0..2d6e1607 100644 --- a/test/plotting/test_plotting.jl +++ b/test/plotting/test_plotting.jl @@ -504,6 +504,18 @@ end @test_nowarn Makie.plot!(ax_lw, plain_body; border_linewidth=3.0) end +@testset "generated_slices reads the deflected .dat under its generated name" begin + gen_dir, _ = ram_air_matrix_dir(; n_sections=4, + alpha_range=deg2rad.(-1:1.0:1), delta_range=deg2rad.(-1:1.0:1)) + fit_pts(x, y) = Point2f.(x, y) + + for delta in (-1.0, 1.0) + slices, _, _ = @test_nowarn makie_ext.generated_slices(gen_dir, delta, fit_pts) + @test all(s -> !isempty(s.d2.def), slices) + @test all(s -> s.def3d !== nothing, slices) + end +end + @testset "Audit slices (Makie)" begin # An all-NaN deflected .dat reads as empty; here a header-only file stands in. gen_dir, _ = ram_air_matrix_dir(; n_sections=4,