diff options
author | Marius Peter <blendoit@gmail.com> | 2019-06-09 11:50:49 -0700 |
---|---|---|
committer | Marius Peter <blendoit@gmail.com> | 2019-06-09 11:50:49 -0700 |
commit | 4baa99bcf568f91ffe9ce961e86185cf42a75a4b (patch) | |
tree | 0b93176901792575ac781f397815ccd1e2d15a7c | |
parent | 9a033eb0777c63537334c5cbff1fc6499b7f7650 (diff) |
class Stringer
-rw-r--r-- | creator.py | 16 | ||||
-rw-r--r-- | main.py | 12 |
2 files changed, 17 insertions, 11 deletions
@@ -236,7 +236,7 @@ class Airfoil(Coordinates): class Spar(Coordinates):
- """Contains a single spar's location and material."""
+ """Contains a single spar's location."""
global parent
def __init__(self):
@@ -275,17 +275,13 @@ class Spar(Coordinates): class Stringer():
- """Contains the coordinates of stringer(s) location and material."""
+ """Contains the coordinates of stringer(s)."""
+ global parent
def __init__(self):
- # Stringer attributes
- self.stringer_x_u = []
- self.stringer_y_u = []
- self.stringer_x_l = []
- self.stringer_y_l = []
- self.stringer_mat = []
-
- def add_stringers(self, *density):
+ super().__init__(parent.chord, parent.semi_span)
+
+ def add_stringer(self, *density):
"""
Add stringers to the wing from their distribution density between spars.
First half of density[] concerns stringer distribution on
@@ -38,6 +38,7 @@ def main(): af.naca(2412) # Print coordinates of af to terminal af.print_coord(4) + # Create spar instance af.spar = creator.Spar() # Define the spar coordinates @@ -45,8 +46,17 @@ def main(): af.spar.add_spar(af.coordinates, 0.55) # Print coordinates of af.spar to terminal af.spar.print_coord(4) + + # Create stringer instance + af.stringer = creator.Stringer() + # Define the stringer coordinates + af.stringer.add_stringer(af.coordinates, 0.15) + af.stringer.add_stringer(af.coordinates, 0.55) + # Print coordinates of af.stringer to terminal + af.stringer.print_coord(4) + # Plot components with matplotlib - creator.plot(af, af.spar) + creator.plot(af, af.spar, af.stringer) # Save component coordinates af.save_coord(SAVE_PATH) |