bluemira.structural.plotting ============================ .. py:module:: bluemira.structural.plotting .. autoapi-nested-parse:: Structural module plotting tools Attributes ---------- .. autoapisummary:: bluemira.structural.plotting.DEFAULT_STRUCT_PLOT_OPTIONS Classes ------- .. autoapisummary:: bluemira.structural.plotting.BasePlotter bluemira.structural.plotting.GeometryPlotter bluemira.structural.plotting.DeformedGeometryPlotter bluemira.structural.plotting.StressDeformedGeometryPlotter Functions --------- .. autoapisummary:: bluemira.structural.plotting.annotate_node bluemira.structural.plotting.annotate_element bluemira.structural.plotting.arrow_scale bluemira.structural.plotting._plot_force bluemira.structural.plotting._plot_moment Module Contents --------------- .. py:data:: DEFAULT_STRUCT_PLOT_OPTIONS .. py:function:: annotate_node(ax: matplotlib.pyplot.Axes, node: bluemira.structural.node.Node, text_size: int, color: str) Annotate a node. .. py:function:: annotate_element(ax: matplotlib.pyplot.Axes, element: bluemira.structural.element.Element, text_size: int, color: str) Annotate an element. .. py:function:: arrow_scale(vector: numpy.ndarray, max_length: float, max_force: float) -> numpy.ndarray Scales an arrow such that, regardless of direction, it has a reasonable size :param vector: 3-D vector of the arrow (3) :param max_length: The maximum length of the arrow :param max_force: The maximum force value in the model (absolute) :rtype: The scaled force arrow (3) .. py:function:: _plot_force(ax: matplotlib.pyplot.Axes, node: bluemira.structural.node.Node, vector: numpy.ndarray, color: str = 'r') Plots a single force arrow in 3-D to indicate a linear load :param ax: The ax on which to plot :param node: The node or location at which the force occurs :param vector: The force direction vector :param color: The color to plot the force as .. py:function:: _plot_moment(ax: matplotlib.pyplot.Axes, node: bluemira.structural.node.Node, vector: numpy.ndarray, color: str = 'r', *, support: bool = False) Plots a double "moment" arrow in 3-D to indicate a moment load. Offset the moment arrows off from the nodes a little, to enable overlaps with forces. :param ax: The ax on which to plot :param node: The node or location at which the force occurs :param vector: The force direction vector :param color: The color to plot the force as .. py:class:: BasePlotter(geometry: bluemira.structural.geometry.Geometry, ax: matplotlib.pyplot.Axes | None = None, **kwargs) Base utility plotting class for structural models .. py:attribute:: geometry .. py:attribute:: options .. py:attribute:: _unit_length :value: None .. py:attribute:: _force_size :value: None .. py:attribute:: _size :value: None .. py:attribute:: color_normer :value: None .. py:property:: unit_length :type: float the minimum element size :type: Calculates a characteristic unit length for the model .. py:property:: force_size :type: float Calculates a characteristic force vector length for plotting purposes :rtype: The minimum and maximum forces .. py:property:: size :type: float Calculates the size of the model bounding box .. py:property:: text_size :type: int Get a reasonable guess of the font size to use in plotting. :returns: **size** -- The font size to use in plotting :rtype: float .. py:method:: plot_nodes() Plots all the Nodes in the Geometry. .. py:method:: plot_supports() Plots all supports in the Geometry. .. py:method:: plot_elements() Plots all of the Elements in the Geometry. .. py:method:: plot_cross_sections() Plots the cross-sections for each Element in the Geometry, rotated to the mid-point of the Element. .. py:method:: plot_loads() Plots all of the loads applied to the geometry .. py:method:: _plot_node_load(node, load) .. py:method:: _plot_element_load(element, load) .. py:method:: _plot_distributed_load(element, load) .. py:method:: _set_aspect_equal() Hack to make matplotlib 3D look good. Draw a white bounding box around the nodes .. py:class:: GeometryPlotter(geometry: bluemira.structural.geometry.Geometry, ax: matplotlib.pyplot.Axes | None = None, **kwargs) Bases: :py:obj:`BasePlotter` .. autoapi-inheritance-diagram:: bluemira.structural.plotting.GeometryPlotter :parts: 1 :private-bases: Utility class for the plotting of structural geometry models .. py:attribute:: options .. py:class:: DeformedGeometryPlotter(geometry: bluemira.structural.geometry.DeformedGeometry, ax: matplotlib.pyplot.Axes | None = None, **kwargs) Bases: :py:obj:`BasePlotter` .. autoapi-inheritance-diagram:: bluemira.structural.plotting.DeformedGeometryPlotter :parts: 1 :private-bases: Utility class for the plotting of structural deformed geometry models and overlaying with GeometryPlotters .. py:attribute:: options .. py:class:: StressDeformedGeometryPlotter(geometry: bluemira.structural.geometry.DeformedGeometry, ax: matplotlib.pyplot.Axes | None = None, stress: numpy.ndarray | None = None, *, deflection: bool = False, **kwargs) Bases: :py:obj:`BasePlotter` .. autoapi-inheritance-diagram:: bluemira.structural.plotting.StressDeformedGeometryPlotter :parts: 1 :private-bases: Utility class for the plotting of structural deformed geometry models and overlaying with GeometryPlotters .. py:attribute:: options .. py:attribute:: color_normer .. py:method:: make_color_normer(stress: numpy.ndarray, *, deflection: bool = False) :staticmethod: Make a ColorNorm object for the plot based on the stress values.