3.6. Display

The geometry module contains objects that help represent where structural elements are in space. Generally, a series of points are represented as nodes, with curves connecting them. Member objects are aggregates of this combination between curves and nodes. Also includes are classes that can represent structural support conditions.

3.6.1. Display Configuration

The display library contains configuration objectsthat are used to control the appearance of limitstates objects. Returns the raw data that can be plotted or rendered. All classes are unit agnostic.

class EleDisplayProps(section: Optional[SectionAbstract] = None, member: Optional[Member] = None, configObject: Optional[PlotConfigObject] = None, configCanvas: Optional[PlotConfigCanvas] = None)[source]

A class that aggregates all propreties which will be used to visualize outputs from elements.

Parameters
  • section (str, SectionAbstract) – The section that will be used for plotting/display. This can be different than design section.

  • member (str, SectionAbstract) – The member used for plotting/display. This can be different than the design section..

  • configCanvas (str, PlotConfigCanvas) – A configuration object that stores the canvas’s .

  • configObject (str, PlotConfigObject) – A configuration object that stores the objects display propreties, i.e. colour linestyle etc.

setPlotOrigin(newOriginLocation: int | limitstates.objects.display.PlotOriginPosition)[source]

Sets the type of origin location to use for the object.

Parameters

newOriginLocation (int|PlotOriginPosition) –

A flag that changes the default location the plot is placed at.

1 is plotted at the centroid. 2 is plotted with the bottom at y = 0, and at the centroid on x. 3 is plotted with the bottom at y = 0, x = 0.

class PlotConfigCanvas(maxFigsize: float = 8, dpi: float = 300, showAxis: bool = True)[source]

Controls how the canvas appears, i.e. size, pixel density, section origin location.

Parameters
  • maxFigsize (str, optional) – The largest allowed dimension for the matplotlib figure.

  • dpi (str, optional) – The density of pixels to use for the output image.

  • showAxis (bool, optional) – A toggle that will turn on or off the axis of the matplotlib canvas..

class PlotConfigObject(c: str = '#B3CFE5', showOutline: bool = True, cLine: str = '#000000', lineWidth: float = 1, originLocation: limitstates.objects.display.PlotOriginPosition | int = 1, cFillLines: Optional[str] = None, cFillPatch: Optional[str] = None)[source]

Controls the appearance of a single object on a matplotlib canvas.

Parameters
  • c (str, optional) – The colour to use for the object.

  • showOutline (bool, optional) – A flag that turns on or off the plots outline.

  • cLine (str, optional) – The colour to use for the outline of the object.

  • lineWidth (float, optional) – The linewidth to use for the object, in units of the canvas.

  • newOriginLocation (int|PlotOriginPosition) –

    A flag that changes the default location the plot is placed at.

    1 is plotted at the centroid. 2 is plotted with the bottom at y = 0, and at the centroid on x. 3 is plotted with the bottom at y = 0, x = 0.

  • cFillLines (str, optional) – The colour to use for any internal fill lines.

  • cFillPatch (str, optional) – The colour to use for any internal fill patches.

class PlotOriginPosition(value)[source]

An enumeration that changes the default location a plot is placed at.

  • 1 is plotted at the centroid.

  • 2 is plotted with the bottom at y = 0, and at the centroid on x.

  • 3 is plotted with the bottom at y = 0, x = 0.

3.6.2. Section Plotting functions

These functions manages matplotlib plotting of sections.

plotElementSection(element: BeamColumn, ax=None, summarizeGeometry: bool | list[str] = False)[source]

Creates a plot of the section the element is using. Only applies to elements that have a “eleDisplayProps” set.

The figure propreties can be set by modifying or replacing the element’s eleDisplayProps object.

If the element has a plot section set, that will be used for plotting instead of the base element.

Parameters
  • element (BeamColumn) – The sectin to be plotted.

  • ax (Axes, optional) – An overwrite that allows plots to be created on a specific figure. The default is None, which creates a new plot.

  • summarizeGeometry (bool|list[str], optional) – XXX currently unused XXX If false, dispalys nothing. If true, tries to find a default proprety list defined in the element.eleDisplayProps If a list, creates a summary of the given attributes. The default is False.

Returns

  • fig (matplotlib figure) – The output matplotlib figure.

  • ax (matplotlib axis) – The output matplotlib axis.

plotSection(section: SectionAbstract, xy0: Optional[list[float, float]] = None, canvasConfig: Optional[PlotConfigCanvas] = None, objectConfig: Optional[PlotConfigObject] = None, ax: Optional[Axes] = None, summarizeGeometry: bool | list[str] = False, *args, **kwargs)[source]

Creates a plot of the section centered at xy0.

A default set of propreties will be chosen for the section depending on it’s type. Custom propreties can also be given to the canvas and object by passing in a canvasConfig object.

The figure propreties can be set by using a custom PlotDisplayProps object.

Steel sections will be plotted with rounded corners, if information about the corner radius exists in r1 / r2.

Where additional arguemts passed to args and kwargs confict with arguments passed in the config object, the arg/kwargs will overwrite the config objects.

Parameters
  • section (SectionAbstract) – The section to be plotted.

  • xy0 (float, optional) – The x/y point to use for the orign of the plot. The default is (0,0). Note that the object may be plotted at a different location

  • dispProps (PlotDisplayProps, optional) – The display propreties to use. The default is None.

  • canvasConfig (PlotConfigCanvas, optional) – The canvas configuration object to be used. The when set to none a default object is used.

  • objectConfig (PlotConfigObject, optional) – The object configuration object to be used. This can be set When set to none, a default object will be chosen based on the on the section type input.

  • ax (Axes, optional) – An overwrite that allows plots to be created on a specific figure. The default is None, which creates a new plot.

  • summarizeGeometry (bool|list[str], optional) – XXX does not work currently. A list of the input attributes to summarize. The default is False.

  • *args (list) – Additional arguments for matplotolib’s ax.fill function

  • **kwargs (dict) – Additional arguments for matplotolib’s ax.fill function

Returns

  • fig (matplotlib figure) – The output matplotlib figure.

  • ax (matplotlib axis) – The output matplotlib axis.