summaryrefslogtreecommitdiff
path: root/creator
diff options
context:
space:
mode:
Diffstat (limited to 'creator')
-rw-r--r--creator/base.py17
-rw-r--r--creator/wing.py2
2 files changed, 12 insertions, 7 deletions
diff --git a/creator/base.py b/creator/base.py
index 5d90efd..33ea680 100644
--- a/creator/base.py
+++ b/creator/base.py
@@ -20,6 +20,9 @@ class Aircraft:
self.propulsion = None
self.wing = None
+ def __str__(self):
+ return self.name
+
class Component:
"""Basic component providing coordinates, tools and a component tree."""
@@ -38,11 +41,11 @@ class Component:
print(num_of_dashes * '-')
print(name)
for k, v in self.__dict__.items():
- if type(v) != list:
+ if type(v) is not np.ndarray:
print(f'{k}:\n', v)
print(num_of_dashes * '-')
for k, v in self.__dict__.items():
- if type(v) == list:
+ if type(v) is np.ndarray:
print(f'{k}:\n', np.around(v, round))
return None
@@ -54,14 +57,16 @@ class Component:
try:
with open(full_path, 'w') as f:
for k, v in self.__dict__.items():
- if type(v) != list:
- f.write(f'{k}:\n')
+ if type(v) is not np.ndarray:
+ f.write(f'{k}=\n')
f.write(str(v))
+ f.write("\n")
# print(num_of_dashes * '-')
for k, v in self.__dict__.items():
- if type(v) == list:
- f.write(f'{k}:\n')
+ if type(v) is np.ndarray:
+ f.write(f'{k}=\n')
f.write(str(v))
+ f.write("\n")
logging.debug(f'Successfully wrote to file {full_path}')
except IOError:
print(f'Unable to write {file_name} to specified directory.\n',
diff --git a/creator/wing.py b/creator/wing.py
index 472e928..b21a68c 100644
--- a/creator/wing.py
+++ b/creator/wing.py
@@ -55,7 +55,7 @@ class Airfoil(base.Component):
def __str__(self):
return self.name
- def add_naca(self, naca_num):
+ def add_naca(self, naca_num=2412):
"""Generate surface geometry for a NACA airfoil.
The nested functions perform the required steps to generate geometry,
Copyright 2019--2024 Marius PETER