pystran.plots module#

Implement simple plots for truss and beam structures.

pystran.plots.plot_applied_forces(m, scale=0.0)[source]#

Plot the applied forces at the joints.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the arrows. Forces are rendered with single arrows. Default is 0.0, which means compute this internally.

pystran.plots.plot_applied_moments(m, scale=0.0, radius=0.0)[source]#

Plot the applied moments at the joints.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the arrows. Moments are rendered with double arrows. Default is 0.0, which means compute this internally.

  • radius – Radius of the circle to represent the moment (2D only). Default is 0.0, which means compute this internally.

pystran.plots.plot_axial_forces(m, scale=0.0)[source]#

Plot the axial forces in the members.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the ordinate. Default is 0.0, which means the scale will be computed internally.

pystran.plots.plot_bending_moments(m, axis='y', scale=0.0)[source]#

Plot the bending moments in the beam members.

Parameters:
  • m – Model dictionary.

  • axis – Either “y” or “z” (default is “z”, which is suitable for 2d beams).

  • scale – Optional: scale factor for the ordinate. Default is 0.0, which means the scale will be computed internally.

pystran.plots.plot_deformations(m, scale=0.0)[source]#

Plot the deformation of the structure.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the deformation. Default is 0.0, which means compute this internally.

  • truss (All)

  • links (rigid)

  • members (and beam members will be included. Truss)

  • be (and rigid links will be displayed as straight; beam members will)

  • functions. (displayed using the cubic shape)

pystran.plots.plot_joint_ids(m)[source]#

Plot the joint identifiers.

Parameters:

m – Model dictionary.

pystran.plots.plot_member_ids(m)[source]#

Plot the member identifiers.

Parameters:

m – Model dictionary.

pystran.plots.plot_member_orientation(m, scale=0.0)[source]#

Plot the member orientations as cartesian triplets.

The vectors are shown as red (x), green (y), and blue (z) lines that represent the basis vectors of a local cartesian coordinate system for each member.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the Cartesian vector lengths. Default is 0.0, which means the scale will be computed internally.

pystran.plots.plot_members(m, max_area=0.0, max_linewidth=2, min_area=0.0, min_linewidth=2)[source]#

Plot the members of the structure.

Parameters:
  • m – Model dictionary.

  • max_area – For the purposes of mapping the cross sectional area to the thickness, consider this to be the maximum. Default is 0.0 (which means it should be computed internally).

  • max_linewidth – Use this as the maximum line width corresponding to the maximum area (default 2).

  • min_area – For the purposes of mapping the cross sectional area to the thickness, consider this to be the minimum. Default is 0.0.

  • min_linewidth – Use this as the minimum line width corresponding to the minimum area (default 2).

  • truss (All)

  • link (rigid)

  • included. (and beam members will be)

pystran.plots.plot_reaction_forces(m, scale=0.0)[source]#

Plot the reaction forces at the joints.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the arrows. Forces are rendered with single arrows. Default is 0.0, which means compute this internally.

pystran.plots.plot_reaction_moments(m, scale=0.0, radius=0.0)[source]#

Plot the reaction moments at the joints.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the arrows. Moments are rendered with double arrows. Default is 0.0, which means compute this internally.

  • radius – Radius of the circle to represent the moment (2D only). Default is 0.0, which means compute this internally.

pystran.plots.plot_rotation_supports(m, scale=0.0, radius=0.0, shortest_arrow=1e-06)[source]#

Plot the rotation supports at the joints.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the arrows. Moments are rendered with double arrows. Default is 0.0, which means compute this internally.

  • radius – Radius of the circle (2D only). Default radius is 0.0, which means the scale is calculated internally.

  • shortest_arrow – How long should the shortest arrow be? Default is 1.0e-6.

pystran.plots.plot_shear_forces(m, axis='z', scale=0.0)[source]#

Plot the shear forces in the beam members.

Parameters:
  • m – Model dictionary.

  • axis – Either “y” or “z” (default is “z”, which is suitable for 2d beams).

  • scale – Optional: scale factor for the ordinate. Default is 0.0, which means the scale will be computed internally.

pystran.plots.plot_torsion_moments(m, scale=0.0)[source]#

Plot the torsion moments in the 3D beam members.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the ordinate. Default is 0.0, which means the scale will be computed internally.

pystran.plots.plot_translation_supports(m, scale=0.0, shortest_arrow=1e-06)[source]#

Plot the translation supports at the joints.

Parameters:
  • m – Model dictionary.

  • scale – Optional: scale factor for the arrows. Moments are rendered with double arrows. Default is 0.0, which means compute this internally.

  • shortest_arrow – How long should the shortest arrow be? Default is 1.0e-6.

pystran.plots.setup(m, set_limits=False)[source]#

Setup the plot.

Parameters:
  • m – Model dictionary.

  • set_limits – Optional: set the limits of the graphics manually or not? Default is False. If True, the bounding box of the structure and its characteristic dimension are used to calculate the limits of the plot.

Returns:

This function creates a figure and an axis object. The axes are returned.

Return type:

axes

pystran.plots.show(m)[source]#

Show the plot.

Parameters:

m – Model dictionary.