sgio.plot_sg_2d_plotly#

sgio.plot_sg_2d_plotly(sg, model, mesh_style: str = 'regions', mesh_color: str = 'rgba(30,30,30,0.9)', mesh_width: float = 1.5, show_principal_axes: bool = True, pba_scale: float = 0.6, show_centers: bool = True, show_origin: bool = True, output_html: str | Path | None = None, title: str = '')#

Plot a single 2D cross-section using plotly (interactive HTML output).

Plotly counterpart of plot_sg_2d(). Renders the section mesh (as a region outline or full wireframe), the principal bending axes and the feature centers (mass / tension / shear). The trace-building helpers are shared with plot_sg_3d_beam_plotly().

Parameters:
  • sg (StructureGene) – The 2D structure gene to plot; must have a mesh attribute.

  • model (object) – Constitutive model with get_center / get_axis_angle methods.

  • mesh_style ({'regions', 'boundary', 'wireframe'}, optional) – Mesh rendering style; see _extract_section_edges(). Default 'regions'.

  • mesh_color (str, optional) – Color string for mesh lines (plotly notation).

  • mesh_width (float, optional) – Mesh line width in pixels. Default 1.5.

  • show_principal_axes (bool, optional) – Whether to draw the principal bending axes. Default True.

  • pba_scale (float, optional) – Principal-axis segment length as a fraction of half the section’s in-plane bounding-box diagonal. Default 0.6.

  • show_centers (bool, optional) – Whether to draw mass / tension / shear centers. Default True.

  • show_origin (bool, optional) – Whether to mark the section origin (0, 0). Default True.

  • output_html (str or Path, optional) – If given, the figure is written to this HTML file.

  • title (str, optional) – Optional figure title.

Returns:

The constructed plotly figure.

Return type:

plotly.graph_objects.Figure