plot_truss_responses¶
- opstool.vis.plotly.plot_truss_responses(odb_tag=1, ele_tags=None, slides=False, step='absMax', show_values=True, resp_type='axialForce', alpha=1.0, show_outline=False, line_width=1.5, unit_symbol=None, unit_factor=None, style='surface', color=None, opacity=1.0, show_bc=False, bc_scale=1.0, show_mp_constraint=False, show_model=False)[source]¶
Visualizing Truss Response.
- Return type:
Figure
Parameters¶
- odb_tag: Union[int, str], default: 1
Tag of output databases (ODB) to be visualized.
- ele_tags: Union[int, list], default: None
The tags of truss elements to be visualized. If None, all truss elements are selected.
- slides: bool, default: False
Display the response for each step in the form of a slideshow. Otherwise, show the step with the following
stepparameter.- step: Union[int, str], default: “absMax”
If slides = False, this parameter will be used as the step to plot. If str, Optional: [absMax, absMin, Max, Min]. If int, this step will be demonstrated (counting from 0).
- show_values: bool, default: False
Whether to display the response value by hover. Set to False can improve the performance of the visualization.
- resp_type: str, default: “axialForce”
Response type, optional, one of [“axialForce”, “axialDefo”, “Stress”, “Strain”].
- alpha: float, default: 1.0
Scale the size of the response graph.
Note
You can adjust the scale to make the response graph more visible. A negative number will reverse the direction.
- show_outline: bool, default: False
Whether to display the outline of the model.
- line_width: float, default: 1.5.
Line width of the response graph.
- unit_symbol: str, default: None
Unit symbol to be displayed in the plot. This feature is added since v1.0.15.
- unit_factor: float, default: None
This feature is added since v1.0.15. The multiplier used to convert units. For example, if you want to visualize stress and the current data unit is kPa, you can set
unit_symbol="kPa" and unit_factor=1.0. If you want to visualize in MPa, you can setunit_symbol="MPa" and unit_factor=0.001.- style: str, default: surface
Visualization mesh style of surfaces and solids. One of the following: style=’surface’ or style=’wireframe’ Defaults to ‘surface’. Note that ‘wireframe’ only shows a wireframe of the outer geometry.
- color: str, default: None
Single color of the response graph. If None, the colormap will be used.
- opacity: float, default: 1.0
Face opacity when style=”surface”.
- show_bc: bool, default: False
Whether to display boundary supports. Set to False can improve the performance of the visualization.
- bc_scale: float, default: 1.0
Scale the size of boundary support display.
- show_mp_constraint: bool, default: False
Whether to show multipoint (MP) constraint. Set to False can improve the performance of the visualization.
- show_model: bool, default: False
Whether to plot the all model or not. Set to False can improve the performance of the visualization.
Returns¶
- fig: plotly.graph_objects.Figure
You can use fig.show() to display, You can also use fig.write_html(“path/to/file.html”) to save as an HTML file, see Interactive HTML Export in Python