sgio.plot_sg_3d_beam#

sgio.plot_sg_3d_beam(csv_file: str | Path, section_dir: str | Path, ax, input_format: str = 'vabs', model_type: str = 'BM2', file_extension: str | None = None, output_extension: str = '.K', location_column: str = 'location', section_column: str = 'cs', axis: int = 0, ec_mesh: str = '0.5', lw_mesh: float = 0.3, mesh_style: str = 'regions', show_principal_axes: bool = True, pba_scale: float = 0.6, connect_centers: bool = True, show_origin_axis: bool = True, aspect_mode: str = 'cube', legend_kwargs: dict | None = None, **read_kwargs)#

Plot multiple beam cross-sections in 3D along the spanwise direction.

For every section listed in the layout CSV the function loads the structure gene (mesh) and the analysis result (constitutive model with centers and principal axes), then renders each section as a wireframe in a 3D matplotlib axes. Feature centers (mass / tension / shear) are connected across sections by polylines.

Parameters:
  • csv_file (str or Path) – Layout CSV file. Must contain a location column and a section column.

  • section_dir (str or Path) – Directory containing the section input files.

  • ax (mpl_toolkits.mplot3d.axes3d.Axes3D) – A 3D matplotlib axes object to plot on. Create with fig.add_subplot(projection='3d').

  • input_format (str, optional) – Format of section input files ('vabs', 'sc', 'swiftcomp'). Default is 'vabs'.

  • model_type (str, optional) – Macro structural model type. Default is 'BM2' (Timoshenko beam).

  • file_extension (str, optional) – Explicit section file extension; if None, inferred from input_format.

  • output_extension (str, optional) – Extension appended to the section path to locate the analysis result file. Default is '.K' (so foo.sg -> foo.sg.K).

  • location_column (str, optional) – Name of the location column in the CSV. Default 'location'.

  • section_column (str, optional) – Name of the section column in the CSV. Default 'cs'.

  • axis (int, optional) – Spanwise axis index (0, 1, or 2). Default 0 (x is spanwise).

  • ec_mesh (str, optional) – Mesh edge color. Default '0.5'.

  • lw_mesh (float, optional) – Mesh line width. Default 0.3.

  • show_principal_axes (bool, optional) – Whether to draw principal bending axes at each section. 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.

  • connect_centers (bool, optional) – Whether to draw 3D polylines connecting mass / tension / shear centers across sections. Default True.

  • show_origin_axis (bool, optional) – Whether to draw a reference line through (0, 0) of each section. Default True.

  • legend_kwargs (dict, optional) – Extra keyword arguments forwarded to ax.legend.

  • **read_kwargs – Extra keyword arguments forwarded to sgio.read().

Returns:

Diagnostic dictionary with keys 'locations', 'mass_centers', 'tension_centers', 'shear_centers' (each a list of 3D points), and 'sections' (the loaded (location, name, sg, model) tuples).

Return type:

dict