sgio.plot_model_2d_plotly#
- sgio.plot_model_2d_plotly(model, sg=None, pba_length: float | None = None, pba_scale: float = 0.6, show_principal_axes: bool = True, show_centers: bool = True, fig=None, output_html: str | Path | None = None, title: str = '')#
Plot the constitutive-model overlays of a 2D beam section using plotly.
Plotly counterpart of
plot_model_2d(). Renders the principal bending axes and the feature centers (mass / tension / shear). Intended to be combined withplot_sg_2d_plotly()by sharing thefig, but can be used on its own.Because the principal-axis segments are drawn with a finite length, their size is taken from
pba_lengthif given, otherwise from the section in-plane extent (whensgis provided), otherwise a unit length.- Parameters:
model (object) – Constitutive model with
get_center/get_axis_anglemethods.sg (StructureGene, optional) – Structure gene whose mesh sets the principal-axis segment length when
pba_lengthis not given. DefaultNone.pba_length (float, optional) – Explicit half-length of the principal-axis segments. Overrides the value derived from
sg. DefaultNone.pba_scale (float, optional) – Principal-axis segment length as a fraction of half the section’s in-plane bounding-box diagonal (used only when the length is derived from
sg). Default 0.6.show_principal_axes (bool, optional) – Whether to draw the principal bending axes. Default True.
show_centers (bool, optional) – Whether to draw mass / tension / shear centers. Default True.
fig (plotly.graph_objects.Figure, optional) – Existing figure to add the overlay traces to. If
Nonea new figure is created. DefaultNone.output_html (str or Path, optional) – If given, the figure is written to this HTML file.
title (str, optional) – Optional figure title (used only when creating a new figure).
- Returns:
The figure the overlays were added to.
- Return type:
plotly.graph_objects.Figure