Skip to content

Fix lofted-airfoil rib placement for +spanwise section order - #256

Merged
1-Bart-1 merged 1 commit into
mainfrom
fix/lofted-airfoil-section-index
Aug 7, 2026
Merged

Fix lofted-airfoil rib placement for +spanwise section order#256
1-Bart-1 merged 1 commit into
mainfrom
fix/lofted-airfoil-section-index

Conversation

@1-Bart-1

@1-Bart-1 1-Bart-1 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Problem

In the Makie extension, airfoil_skin_geometry draws one lofted airfoil rib per section by fitting the section's contour onto a panel edge. It picked the edge with:

plus_edge = i <= n_panels ? !increasing : increasing

where increasing tests whether refined_sections run along +spanwise.

Panels are always built with refined_sections[p]corner_points col 1/2 and refined_sections[p+1] → col 4/3 (init_pos!), independent of span order. So the edge for section i is purely index-based:

  • i <= n_panels → panel i's first edge (col 1/2)
  • i == n (last section) → last panel's second edge (col 4/3)

The increasing term is spurious. It is a no-op for −spanwise wings (increasing == false) but inverts every mapping for +spanwise wings (increasing == true): each section's contour is lofted onto its neighbour's station. The result is a missing rib at the first-section tip and a doubled/folded rib at the last-section tip, while the VSM panels themselves render correctly.

Observed on an SK100 wing (sections ordered −y→+y): no lofted airfoil at the most-negative-y tip, a folded double airfoil at the most-positive-y tip.

Fix

first_edge = i <= n_panels

This reproduces the previous (correct) output for −spanwise wings and fixes the +spanwise case. spanwise/increasing are no longer needed and are removed.

Notes

  • Plotting-only change; no effect on aero results.
  • Changelog left to the maintainer's release batching, matching recent post-release commits.

🤖 Generated with Claude Code

`airfoil_skin_geometry` chose which panel edge to loft each section's
contour onto with `plus_edge = i <= n_panels ? !increasing : increasing`,
where `increasing` tests whether the refined sections run along +spanwise.
But panels are always built with `refined_sections[p]` as corner 1/2 and
`refined_sections[p+1]` as corner 4/3 (`init_pos!`), independent of span
order, so the correct edge is purely index-based: section `i` sits on
panel `i`'s first edge for `i <= n_panels`, and on the last panel's second
edge for the final section.

For a wing whose sections run −y→+y (`increasing == true`) the old
expression inverted every mapping, drawing each section's contour at its
neighbour's station: the first-section tip got no rib and the last-section
tip got a doubled (folded) rib, while the VSM panels rendered correctly.
Replace it with `first_edge = i <= n_panels`, which reproduces the previous
(correct) result for −spanwise wings and fixes the +spanwise case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@1-Bart-1
1-Bart-1 merged commit 6288bff into main Aug 7, 2026
9 checks passed
@1-Bart-1
1-Bart-1 deleted the fix/lofted-airfoil-section-index branch August 7, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant