summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-06-29 14:05:04 -0700
committerMarius Peter <blendoit@gmail.com>2019-06-29 14:05:04 -0700
commit2bd4de876393f45d701c849d47db0542b4509962 (patch)
tree994d8a088cff860abb28a8635fa70012bd39d3cc
parentdbaeb7d1f1f062a8639f87ed4dfb2eb11d856f10 (diff)
remove global variable in creator.py
-rw-r--r--creator.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/creator.py b/creator.py
index 1431e11..4368400 100644
--- a/creator.py
+++ b/creator.py
@@ -78,6 +78,7 @@ class Coordinates:
This function's output is piped to the 'save_coord' function below.
"""
+
name = ' CREATOR DATA '
num_of_dashes = len(name)
@@ -96,6 +97,7 @@ class Coordinates:
"""
Save all the object's coordinates (must be full path).
"""
+
file_name = '{}_{}.txt'.format(str(self).lower(), number)
full_path = os.path.join(save_path, file_name)
try:
@@ -126,7 +128,6 @@ class Airfoil(Coordinates):
"""
def __init__(self):
- global parent
# Run 'Coordinates' super class init method with same chord & 1/2 span.
super().__init__()
self.chord = Coordinates.chord
@@ -259,6 +260,7 @@ class Spar(Coordinates):
Return:
None
"""
+
# Scaled spar location with regards to chord
loc = x_loc_percent * self.chord
# bi.bisect_left: returns index of first value in airfoil.x > loc
@@ -328,6 +330,7 @@ class Stringer(Coordinates):
Returns:
None
"""
+
# Find distance between leading edge and first upper stringer
interval = airfoil.spar.x[0][0] / (stringer_u_1 + 1)
# initialise first self.stringer_x at first interval
@@ -396,6 +399,7 @@ class Stringer(Coordinates):
def plot_geom(airfoil):
"""This function plots the airfoil's + sub-components' geometry."""
+
# Plot chord
x_chord = [0, airfoil.chord]
y_chord = [0, 0]
Copyright 2019--2024 Marius PETER