magnet.io.exploded_view#

magnet.io.exploded_view(mesh: AggMesh, scale: float = 1, palette: str | list | None = None, background: str = 'white', edge_color: str | None = None, edge_width: int = 1, orientation: tuple[int, int, int] = (0, 0, 0), figsize: tuple[int, int] = (800, 600), save_image_path: str | None = None, image_scaling: int = 2, title: str | None = None)#

Visualize exploded mesh using vtk renderer.

Creates a vtk window interactor displaying the mesh, in which each element has been translated by the distance of its centroid from the center of the mesh bounding box, multiplied by scale so that it appears exploded. If scale=0 visualizes the original mesh. Additionally, allows to save a png image of the rendered window.

Parameters:
  • mesh (AggMesh) – Mesh to visualize.

  • scale (float, optional) – Factor that describes the ‘intensity’ of the explosion. If set to 0, visualizes the original mesh. default is 1.

  • palette (str or list of str, optional) – Color palette for mesh elements, or single color for all of them. If None, uses a default color palette.

  • background (str, optional) – Background color. Default is ‘white’.

  • edge_color (str, optional) – Color of the edges of the faces. If None, they are not visualized.

  • edge_width (int, optional) – Width of the edges of the faces in pixels. Default is 1.

  • orientation (tuple[int, int, int], optional) – Initial angles of rotation (pitch, roll, ) of the object, expressed in degrees.

  • figsize (tuple[int, int], optional) – Size of the renderer window. Default is (800, 600).

  • save_image_path (str, optional) – Path where the png image will be saved. If not given, the image will not be saved.

  • image_scaling (int, optional) – Scale image factor when exporting to png. For example, 2 means that the image size is doubled.

  • title (str, optional) – Title of the displayed window

Return type:

None