Skip to content

circular

structural_sections.concrete.reinforced_concrete_sections.plotters.circular

Plotter for Reinforced Circular Cross-Sections.

Classes:

structural_sections.concrete.reinforced_concrete_sections.plotters.circular.CircularCrossSectionPlotter

CircularCrossSectionPlotter(cross_section: T)

Plotter for Reinforced Circular Cross-Sections (RCCS).

Initialize the RCCSPlotter.

Parameters:

  • cross_section (T) –

    Reinforced cross-section to plot.

Source code in blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/circular.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(
    self,
    cross_section: T,
) -> None:
    """Initialize the RCCSPlotter.

    Parameters
    ----------
    cross_section: CircularReinforcedCrossSection
        Reinforced cross-section to plot.
    """
    self.cross_section = cross_section
    self.fig: plt.Figure | None = None
    self.axes: list[Axes] = []

structural_sections.concrete.reinforced_concrete_sections.plotters.circular.CircularCrossSectionPlotter.legend_text

legend_text() -> str

Creates the legend text.

Returns:

  • str

    Legend text.

Source code in blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/circular.py
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
def legend_text(self) -> str:
    """Creates the legend text.

    Returns
    -------
    str
        Legend text.
    """
    # start building legend
    steel_materials = self.cross_section.get_present_steel_materials()
    if steel_materials:
        main_steel_material_used = steel_materials[0].name
        legend_text = f"{self.cross_section.concrete_material.concrete_class.value} - {main_steel_material_used}"
    else:
        legend_text = f"{self.cross_section.concrete_material.concrete_class.value}"

    legend_text += self._add_stirrups_to_legend()
    legend_text += self._add_longitudinal_rebars_to_legend()
    legend_text += self._add_rebar_configurations_to_legend()
    legend_text += self._add_single_longitudinal_rebars_to_legend()
    legend_text += self._add_covers_info_to_legend()

    return legend_text

structural_sections.concrete.reinforced_concrete_sections.plotters.circular.CircularCrossSectionPlotter.plot

plot(
    figsize: tuple[float, float] = (15.0, 8.0),
    title: str | None = None,
    font_size_title: float = 18.0,
    font_size_legend: float = 10.0,
    include_legend: bool = True,
    font_size_dimension: float = 12.0,
    custom_text_legend: str | None = None,
    custom_text_diameter: str | None = None,
    offset_line_diameter: float = 1.25,
    center_line_style: dict[str, float | str] | None = None,
    show: bool = False,
    axes_i: int = 0,
) -> Figure

Plots the cross-section.

Parameters:

  • figsize (tuple[float, float], default: (15.0, 8.0) ) –

    Size of the plot window.

  • title (str | None, default: None ) –

    Title of the plot.

  • font_size_title (float, default: 18.0 ) –

    Font size of the title.

  • font_size_legend (float, default: 10.0 ) –

    Font size of the legend.

  • include_legend (bool, default: True ) –

    Include legend in the plot.

  • font_size_dimension (float, default: 12.0 ) –

    Font size of the dimensions.

  • custom_text_legend (str | None, default: None ) –

    Custom text for the legend.

  • custom_text_diameter (str | None, default: None ) –

    Custom text for the diameter dimension. Replaces the diameter of the cross-section with the custom text.

  • offset_line_diameter (float, default: 1.25 ) –

    Offset of the diameter line.

  • center_line_style (dict[str, float | str] | None, default: None ) –

    Style of the center lines. Check matplotlib documentation for more information (Annotation-arrowprops).

  • show (bool, default: False ) –

    Show the plot.

  • axes_i (int, default: 0 ) –

    Index of the axes to plot on. Default is 0.

Returns:

  • Figure

    Matplotlib figure.

Source code in blueprints/structural_sections/concrete/reinforced_concrete_sections/plotters/circular.py
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def plot(
    self,
    figsize: tuple[float, float] = (15.0, 8.0),
    title: str | None = None,
    font_size_title: float = 18.0,
    font_size_legend: float = 10.0,
    include_legend: bool = True,
    font_size_dimension: float = 12.0,
    custom_text_legend: str | None = None,
    custom_text_diameter: str | None = None,
    offset_line_diameter: float = 1.25,
    center_line_style: dict[str, float | str] | None = None,
    show: bool = False,
    axes_i: int = 0,
) -> plt.Figure:
    """Plots the cross-section.

    Parameters
    ----------
    figsize: tuple[float, float]
        Size of the plot window.
    title: str
        Title of the plot.
    font_size_title: float
        Font size of the title.
    font_size_legend: float
        Font size of the legend.
    include_legend: bool
        Include legend in the plot.
    font_size_dimension: float
        Font size of the dimensions.
    custom_text_legend: str
        Custom text for the legend.
    custom_text_diameter: str
        Custom text for the diameter dimension. Replaces the diameter of the cross-section with the custom text.
    offset_line_diameter: float
        Offset of the diameter line.
    center_line_style: dict[str, float | str] | None
        Style of the center lines. Check matplotlib documentation for more information (Annotation-arrowprops).
    show: bool
        Show the plot.
    axes_i: int
        Index of the axes to plot on. Default is 0.

    Returns
    -------
    plt.Figure
        Matplotlib figure.
    """
    self._start_plot(figsize=figsize)
    self._add_circle(axes_i=axes_i)
    self._add_center_lines(axes_i=axes_i, style=center_line_style)
    self._add_dimension_lines(
        axes_i=axes_i,
        font_size_dimension=font_size_dimension,
        custom_text_diameter=custom_text_diameter,
        offset_line_diameter=offset_line_diameter,
    )
    self._add_stirrups(axes_i=axes_i)
    self._add_longitudinal_rebars(axes_i=axes_i)

    # set limits and title
    self.axes[axes_i].axis("off")
    self.axes[axes_i].axis("equal")
    self.axes[axes_i].set_title(
        label=title or "",
        fontdict={"fontsize": font_size_title},
    )

    if include_legend:
        self._add_legend(
            axes_i=axes_i,
            font_size_legend=font_size_legend,
            custom_legend_text=custom_text_legend,
        )
    if show:
        plt.show()  # pragma: no cover
    assert self.fig is not None
    return self.fig