Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
x = np.hstack((x_U, x_L))
y = np.hstack((y_U, y_L))
coordinates = np.column_stack((x, y))
self.coordinates = coordinates
return
else:
print("Unfortunately, only 4-series NACA airfoils can be generated at this time.")
# Try to read from airfoil database
try:
import importlib.resources
from . import airfoils
raw_text = importlib.resources.read_text(airfoils, name + '.dat')
trimmed_text = raw_text[raw_text.find('\n'):]
coordinates1D = np.fromstring(trimmed_text, sep='\n') # returns the coordinates in a 1D array
assert len(
coordinates1D) % 2 == 0, 'File was found in airfoil database, but it could not be read correctly!' # Should be even
coordinates = np.reshape(coordinates1D, (-1, 2))
self.coordinates = coordinates
return
except FileNotFoundError:
print("File was not found in airfoil database!")