Skip to content

Commit

Permalink
Merge pull request #628 from suavecode/fix-airfoil_import
Browse files Browse the repository at this point in the history
fixing extra airfoil zeros
  • Loading branch information
planes committed Nov 9, 2022
2 parents f05ed3f + 6ffd28d commit b16eb3f
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -141,7 +141,7 @@ def import_airfoil_geometry(airfoil_geometry_file, npoints = 200,surface_interpo
next_line = data_block[line_count+1].strip()
next_line = next_line.replace(',','')

if next_line.split()[0]>line_check.split()[0] and next_line.split()[0] !=0.:
if next_line.split()[0]>line_check.split()[0] and float(next_line.split()[0]) >0.:
upper_surface_flag = False

# Upper surface values in Selig format are reversed from Lednicer format, so fix that
Expand All @@ -155,6 +155,13 @@ def import_airfoil_geometry(airfoil_geometry_file, npoints = 200,surface_interpo
x_lo_surf = np.array(x_lo_surf)
y_up_surf = np.array(y_up_surf)
y_lo_surf = np.array(y_lo_surf)

# Check for extra zeros (OpenVSP exports extra zeros)
if len(np.unique(x_up_surf))!=len(x_up_surf):
x_up_surf = x_up_surf[1:]
x_lo_surf = x_lo_surf[1:]
y_up_surf = y_up_surf[1:]
y_lo_surf = y_lo_surf[1:]

# create custom spacing for more points and leading and trailing edge
t = np.linspace(0,4,npoints-1)
Expand Down

0 comments on commit b16eb3f

Please sign in to comment.