Muscat.Bridges.PlotlyBridge module

CheckIntegrity(GUI: bool = False)[source]
GetPlotlySurfaceMesh(myMesh: Mesh, fieldToPlot: str | ndarray | None = None)[source]

Function to convert a Mesh and a Nodal fields (element fields to yet implemented) to a Plotly graph_object Mesh3d library. Internally the norm of the field is computed if the fieldToPlot is a vector field (like normals).

(This functions need the plotly package installed)

Parameters:
  • myMesh (Mesh) – The mesh to be converted

  • fieldToPlot (Optional[Union[str,np.ndarray]], optional) – point field or point field name to put the intensity field of the Mesh3d. by default None

Returns:

the mesh converted to Plotly format

Return type:

plotly.graph_objects.Mesh3d

Raises:
  • RuntimeError – if field.shape[0] != number of node of the mesh

  • RuntimeError – if the field name is not present in the mesh.nodesFields

PlotMesh(mesh: Mesh | Mesh3d, nodeFieldToPlot: str | ndarray | None = None)[source]

Plot a mesh using Plotly (This functions need the plotly package installed)

Parameters:
  • mesh (Union[Mesh,'Mesh3d']) – Mesh to plot (Muscat Mesh or plotly Mesh3D)

  • fieldToPlot (Optional[Union[str,np.ndarray]], optional) – point field or point field name to put the intensity field of the Mesh3d. by default None

Returns:

the Plotly figure

Return type:

Plotly Figure