The utils.py
module#
Summary#
Convert bgr integer to rgb tuple. |
|
Extract the nodes and coordinates from the LineTessellationNode. |
|
Extract the nodes and coordinates from the TriTessellationNode. |
|
Extract the defomation and results from the TriTessellationResultNode. |
|
Get the scene of the model. |
|
Get the scene for the given object. |
Description#
Common plotting utilities.
Module detail#
- utils.get_line_nodes_and_coords(line_tessellation: Ansys.Mechanical.Scenegraph.LineTessellationNode)#
Extract the nodes and coordinates from the LineTessellationNode.
The TriTessellationNode contains “Coordinates” and “Indices” that are flat arrays. This function converts them to numpy arrays
- utils.get_tri_nodes_and_coords(tri_tessellation: Ansys.Mechanical.Scenegraph.TriTessellationNode)#
Extract the nodes and coordinates from the TriTessellationNode.
The TriTessellationNode contains “Coordinates” and “Indices” that are flat arrays. This function converts them to numpy arrays of the appropriate shape.
- utils.get_tri_result_disp_and_results(tri_tessellation: Ansys.Mechanical.Scenegraph.TriTessellationResultNode)#
Extract the defomation and results from the TriTessellationResultNode.
The TriTessellationResultNode contains “Displacements” and “Results” that are flat arrays. This function converts them to numpy arrays of the appropriate shape.
- utils.get_scene(app: ansys.mechanical.core.embedding.App) Ansys.Mechanical.Scenegraph.GroupNode #
Get the scene of the model.
- utils.get_scene_for_object(app: ansys.mechanical.core.embedding.App, obj) Ansys.Mechanical.Scenegraph.Node #
Get the scene for the given object.
2025R2 and before: only geometry is supported later, Mesh and some Results will be supported.