@@ -186,7 +186,8 @@ function Wing(
186186 spanwise_distribution= LINEAR,
187187 spanwise_direction= [0.0 , 1.0 , 0.0 ],
188188 remove_nan= true ,
189- prn= false
189+ prn= false ,
190+ sort_sections= true
190191)
191192
192193 ! isapprox (spanwise_direction, [0.0 , 1.0 , 0.0 ]) && throw (ArgumentError (" Spanwise direction has to be [0.0, 1.0, 0.0], not $spanwise_direction " ))
@@ -262,7 +263,7 @@ function Wing(
262263 add_section! (wing, le_coord, te_coord, aero_model, aero_data)
263264 end
264265
265- refine! (wing)
266+ refine! (wing; sort_sections )
266267 return wing
267268end
268269
@@ -296,7 +297,7 @@ wing = Wing(settings)
296297# - obj_file + dat_file # OBJ-based
297298```
298299"""
299- function Wing (settings:: VSMSettings )
300+ function Wing (settings:: VSMSettings ; sort_sections :: Bool = true )
300301 wing_settings = settings. wings[1 ]
301302
302303 # Check which geometry format to use
@@ -327,10 +328,11 @@ function Wing(settings::VSMSettings)
327328 Wing (wing_settings. geometry_file;
328329 n_panels= wing_settings. n_panels,
329330 spanwise_distribution= wing_settings. spanwise_panel_distribution,
330- remove_nan= wing_settings. remove_nan
331+ remove_nan= wing_settings. remove_nan,
332+ sort_sections
331333 )
332334 elseif has_obj && has_dat
333- # Use ObjWing constructor
335+ # Use ObjWing constructor (ObjWing doesn't sort sections internally)
334336 ObjWing (
335337 wing_settings. obj_file,
336338 wing_settings. dat_file;
0 commit comments