class Stringer

Commit
4baa99bcf568f91ffe9ce961e86185cf42a75a4b
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
Changed files
creator.py
index b1a58a99..953f0885 100644..100644
@@ -236,7 +236,7 @@
236 236
237 237
238 238 class Spar(Coordinates):
239 Removed: """Contains a single spar's location and material."""
239 Added: """Contains a single spar's location."""
240 240 global parent
241 241
242 242 def __init__(self):
@@ -275,17 +275,13 @@
275 275
276 276
277 277 class Stringer():
278 Removed: """Contains the coordinates of stringer(s) location and material."""
278 Added: """Contains the coordinates of stringer(s)."""
279 Added: global parent
279 280
280 281 def __init__(self):
281 Removed: # Stringer attributes
282 Removed: self.stringer_x_u = []
283 Removed: self.stringer_y_u = []
284 Removed: self.stringer_x_l = []
285 Removed: self.stringer_y_l = []
286 Removed: self.stringer_mat = []
282 Added: super().__init__(parent.chord, parent.semi_span)
287 283
288 Removed: def add_stringers(self, *density):
284 Added: def add_stringer(self, *density):
289 285 """
290 286 Add stringers to the wing from their distribution density between spars.
291 287 First half of density[] concerns stringer distribution on
main.py
index f62a88aa..4bbd7a9d 100644..100644
@@ -38,6 +38,7 @@
38 38 af.naca(2412)
39 39 # Print coordinates of af to terminal
40 40 af.print_coord(4)
41 Added:
41 42 # Create spar instance
42 43 af.spar = creator.Spar()
43 44 # Define the spar coordinates
@@ -45,8 +46,17 @@
45 46 af.spar.add_spar(af.coordinates, 0.55)
46 47 # Print coordinates of af.spar to terminal
47 48 af.spar.print_coord(4)
49 Added:
50 Added: # Create stringer instance
51 Added: af.stringer = creator.Stringer()
52 Added: # Define the stringer coordinates
53 Added: af.stringer.add_stringer(af.coordinates, 0.15)
54 Added: af.stringer.add_stringer(af.coordinates, 0.55)
55 Added: # Print coordinates of af.stringer to terminal
56 Added: af.stringer.print_coord(4)
57 Added:
48 58 # Plot components with matplotlib
49 Removed: creator.plot(af, af.spar)
59 Added: creator.plot(af, af.spar, af.stringer)
50 60
51 61 # Save component coordinates
52 62 af.save_coord(SAVE_PATH)