summaryrefslogtreecommitdiff
path: root/creator.py
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-06-30 10:41:31 -0700
committerMarius Peter <blendoit@gmail.com>2019-06-30 10:41:31 -0700
commitd07acde07a51805bf4c5967ca5e3243b4163dc15 (patch)
tree45eea30b8ebf7b0e9fe7299643d35204a88b9ffa /creator.py
parent59a41c177ce3f3e0f488708466ea0eec09da3294 (diff)
spar placement
Diffstat (limited to 'creator.py')
-rw-r--r--creator.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/creator.py b/creator.py
index eaf4d68..756a8f5 100644
--- a/creator.py
+++ b/creator.py
@@ -32,6 +32,7 @@ import numpy as np
from math import sin, cos, atan, sqrt
import bisect as bi
import matplotlib.pyplot as plt
+from matplotlib.figure import Figure
class Airfoil:
@@ -235,7 +236,7 @@ class Spar(Airfoil):
x = [airfoil.x[spar_x]]
z = [airfoil.z[spar_x]]
# Spar lower coordinates
- spar_x = bi.bisect_left(airfoil.x[::-1], loc) - 1
+ spar_x = bi.bisect_left(airfoil.x[::-1], loc)
x += [airfoil.x[-spar_x]]
z += [airfoil.z[-spar_x]]
self.x.append(x)
@@ -361,6 +362,7 @@ class Stringer(Airfoil):
def plot_geom(airfoil):
"""This function plots the airfoil's + sub-components' geometry."""
+ fig = Figure()
# Plot chord
x_chord = [0, airfoil.chord]
y_chord = [0, 0]
@@ -379,7 +381,7 @@ def plot_geom(airfoil):
for _ in range(len(airfoil.spar.x)):
x = (airfoil.spar.x[_])
y = (airfoil.spar.z[_])
- plt.plot(x, y, '-', color='b')
+ plt.plot(x, y, '-', color='y', linewidth='4')
except AttributeError:
print('No spars to plot.')
# Plot stringers
Copyright 2019--2024 Marius PETER