Commit 6288bff
Fix lofted-airfoil rib placement for +spanwise section order (#256)
`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>1 parent 4ba4f14 commit 6288bff
1 file changed
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | 139 | | |
143 | 140 | | |
144 | 141 | | |
| |||
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
| |||
0 commit comments