Skip to content

Commit

Permalink
Better
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccomb committed Jan 3, 2024
1 parent 06c5f28 commit 34b7648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions trussme/truss.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ def fos_yielding(self) -> float:
@property
def fos_buckling(self) -> float:
"""float: Smallest buckling FOS of any member in the truss"""
return min(
[m.fos_buckling if m.fos_buckling > 0 else numpy.inf for m in self.members]
)
return min([m.fos_buckling for m in self.members])

@property
def fos(self) -> float:
Expand Down
4 changes: 2 additions & 2 deletions trussme/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def plot_truss(

force_colormap = matplotlib.colors.LinearSegmentedColormap.from_list(
"force",
numpy.array([[1.0, 0.0, 0.0], [0.7, 0.7, 0.7], [0.0, 0.0, 1.0]]),
numpy.array([[1.0, 0.0, 0.0], [0.8, 0.8, 0.8], [0.0, 0.0, 1.0]]),
)

for member in truss.members:
Expand Down Expand Up @@ -81,7 +81,7 @@ def plot_truss(
else "r"
)
elif deflected_shape == "force":
color = matplotlib.pyplot.cm.bwr(member.force / (2 * scaler) + 0.5)
color = force_colormap(member.force / (2 * scaler) + 0.5)
elif deflected_shape is None:
break
else:
Expand Down

0 comments on commit 34b7648

Please sign in to comment.