This week, I opened my final PR #23991 for the Truss
class and effectively for this summer as well. It’s incredible how fast these couple of months have gone by and how I am officially in the very final phase of my project. Fortunately, unlike my previous PR, all tests have passed successfully without any hassle and I am just waiting for reviews.
The draw
method calls four different methods during its functioning: draw_nodes
, draw_members
, draw_loads
, and draw_supports
. Nodes and supports are drawn/plotted on the main plot by denoting them with markers. These markers are of various shapes and their sizes can be adjusted as well. A node is denoted by a simple black solid circle. The pinned and roller supports are marked with the help of a black hollow triangle and a black hollow circle respectively.
For the loads, annotations have been used. The direction of the arrow/annotation is denoted by the two points xy
(the node itself) and xytext
. The magnitude of the load does not matter here and by looking at the angle, the point xytext
is tweaked accordingly so that the arrow makes the required angle with the horizontal. There were some issues concerning the scaling of the truss and hence how the xytext
would have to be tweaked. After some trial and error and seeing how the plot responds, a final relation was reached successfully.
Finally, the members are just lines between two markers whose coordinates are already known. These are just brown straight plot lines between two black solid markers.
Here is an example of a plot object of a simple Truss showing all of the above-mentioned properties.