mirror of
https://gitlab.com/MisterBiggs/aero-astro-calc.git
synced 2025-06-15 22:56:47 +00:00
code cleanup
This commit is contained in:
parent
8a59fa2836
commit
a77872c24d
@ -17,8 +17,8 @@ class PlaneStress:
|
||||
self.sigma_2 = ((self.sigma_x + self.sigma_y) / 2) - self.tau_max
|
||||
|
||||
def plane(self):
|
||||
# Settings to make the plot look correct.
|
||||
plot = figure(x_range=(-5, 5), y_range=(-5, 5))
|
||||
|
||||
plot.axis.major_label_text_font_size = "0pt"
|
||||
plot.axis.major_tick_line_color = None
|
||||
plot.axis[0].ticker.num_minor_ticks = 0
|
||||
@ -26,6 +26,7 @@ class PlaneStress:
|
||||
plot.grid.visible = False
|
||||
plot.axis.visible = False
|
||||
|
||||
# Draw the rectangle
|
||||
plot.rect(0, 0, 4, 4, fill_alpha=0, line_color="black", line_width=3)
|
||||
|
||||
# sigma_x
|
||||
@ -33,7 +34,7 @@ class PlaneStress:
|
||||
plot.add_layout(Arrow(x_start=-2, y_start=0, x_end=-4.5, y_end=0))
|
||||
plot.add_layout(
|
||||
LatexLabel(
|
||||
x=3.5, y=0.75, text=f"\\sigma_{{x}} = {self.sigma_x}", render_mode="css"
|
||||
x=3.0, y=0.7, text=f"\\sigma_{{x}} = {self.sigma_x}", render_mode="css"
|
||||
)
|
||||
)
|
||||
|
||||
@ -49,6 +50,8 @@ class PlaneStress:
|
||||
# tau_xy
|
||||
plot.add_layout(Arrow(x_start=2.5, y_start=-2, x_end=2.5, y_end=2.2))
|
||||
plot.add_layout(Arrow(y_start=2.5, x_start=-2, y_end=2.5, x_end=2.2))
|
||||
plot.add_layout(Arrow(x_start=-2.5, y_start=2, x_end=-2.5, y_end=-2.2))
|
||||
plot.add_layout(Arrow(y_start=-2.5, x_start=2, y_end=-2.5, x_end=-2.2))
|
||||
plot.add_layout(
|
||||
LatexLabel(
|
||||
x=2.5, y=2.6, text=f"\\tau_{{xy}} = {self.tau_xy}", render_mode="css"
|
||||
@ -83,7 +86,3 @@ class PlaneStress:
|
||||
|
||||
show(plot)
|
||||
|
||||
|
||||
x = PlaneStress(80, -40, 25)
|
||||
|
||||
x.plane()
|
||||
|
Loading…
x
Reference in New Issue
Block a user