GeometryPlotter#
- class ansys.geometry.core.plotting.plotter.GeometryPlotter(use_trame: bool | None = None, use_service_colors: bool | None = None, allow_picking: bool = False, show_plane: bool = True)#
 Bases:
ansys.tools.visualization_interface.PlotterPlotter for PyAnsys Geometry objects.
This class is an implementation of the PlotterInterface class.
- Parameters:
 - use_tramebool, 
optional Whether to use trame visualizer or not, by default None.
- use_service_colorsbool, 
optional Whether to use service colors or not, by default None.
- allow_pickingbool, 
optional Whether to allow picking or not, by default False.
- show_planebool, 
optional Whether to show the plane in the scene, by default True.
- use_tramebool, 
 
Overview#
Plot a frame in the scene.  | 
|
Plot a plane in the scene.  | 
|
Plot a sketch in the scene.  | 
|
Add the outer edges of a body to the plot.  | 
|
Add a body to the scene.  | 
|
Add a face to the scene.  | 
|
Add a component to the scene.  | 
|
Add a component on a per body basis.  | 
|
Add sketches to the scene from PyVista polydata.  | 
|
Add a DesignPoint object to the plotter.  | 
|
Add a list of any type of object to the scene.  | 
|
Add a custom mesh to the plotter.  | 
|
Show the plotter.  | 
|
Export the design to a glb file. Does not support picked objects.  | 
Indicates whether to use service colors for plotting purposes.  | 
Import detail#
from ansys.geometry.core.plotting.plotter import GeometryPlotter
Property detail#
Method detail#
- GeometryPlotter.add_frame(frame: ansys.geometry.core.math.frame.Frame, plotting_options: dict | None = None) None#
 Plot a frame in the scene.
- Parameters:
 - frame
Frame Frame to render in the scene.
- plotting_options
dict, default:None dictionary containing parameters accepted by the
pyvista.create_axes_marker()class for customizing the frame rendering in the scene.
- frame
 
- GeometryPlotter.add_plane(plane: ansys.geometry.core.math.plane.Plane, plane_options: dict | None = None, plotting_options: dict | None = None) None#
 Plot a plane in the scene.
- Parameters:
 - plane
Plane Plane to render in the scene.
- plane_options
dict, default:None dictionary containing parameters accepted by the
pyvista.Planefunction for customizing the mesh representing the plane.- plotting_options
dict, default:None dictionary containing parameters accepted by the
Plotter.add_meshmethod for customizing the mesh rendering of the plane.
- plane
 
- GeometryPlotter.add_sketch(sketch: ansys.geometry.core.sketch.sketch.Sketch, show_plane: bool = False, show_frame: bool = False, **plotting_options: dict | None) None#
 Plot a sketch in the scene.
- Parameters:
 - sketch
Sketch Sketch to render in the scene.
- show_planebool, default: 
False Whether to render the sketch plane in the scene.
- show_framebool, default: 
False Whether to show the frame in the scene.
- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- sketch
 
- GeometryPlotter.add_body_edges(body_plot: ansys.tools.visualization_interface.MeshObjectPlot, **plotting_options: dict | None) None#
 Add the outer edges of a body to the plot.
This method has the side effect of adding the edges to the GeomObject that you pass through the parameters.
- Parameters:
 - body_plot
MeshObjectPlot Body of which to add the edges.
- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- body_plot
 
- GeometryPlotter.add_body(body: ansys.geometry.core.designer.body.Body, merge: bool = False, **plotting_options: dict | None) None#
 Add a body to the scene.
- Parameters:
 - body
Body Body to add.
- mergebool, default: 
False Whether to merge the body into a single mesh. When
True, the individual faces of the tessellation are merged. This preserves the number of triangles and only merges the topology.- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- body
 
- GeometryPlotter.add_face(face: ansys.geometry.core.designer.face.Face, **plotting_options: dict | None) None#
 Add a face to the scene.
- Parameters:
 - face
Face Face to add.
- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- face
 
- GeometryPlotter.add_component(component: ansys.geometry.core.designer.component.Component, merge_component: bool = False, merge_bodies: bool = False, **plotting_options) None#
 Add a component to the scene.
- Parameters:
 - component
Component Component to add.
- merge_componentbool, default: 
False Whether to merge the component into a single dataset. When
True, all the individual bodies are effectively combined into a single dataset without any hierarchy.- merge_bodiesbool, default: 
False Whether to merge each body into a single dataset. When
True, all the faces of each individual body are effectively combined into a single dataset without separating faces.- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- component
 
- GeometryPlotter.add_component_by_body(component: ansys.geometry.core.designer.component.Component, merge_bodies: bool, **plotting_options: dict | None) None#
 Add a component on a per body basis.
- Parameters:
 - component
Component Component to add.
- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- component
 
Notes
This will allow to make use of the service colors. At the same time, it will be slower than the add_component method.
- GeometryPlotter.add_sketch_polydata(polydata_entries: list[pyvista.PolyData], sketch: ansys.geometry.core.sketch.sketch.Sketch = None, **plotting_options) None#
 Add sketches to the scene from PyVista polydata.
- Parameters:
 - polydata_entries
list[pyvista.PolyData] Polydata to add.
- sketch
Sketch, default:None Sketch to add.
- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, see the
Plotter.add_meshmethod.
- polydata_entries
 
- GeometryPlotter.add_design_point(design_point: ansys.geometry.core.designer.designpoint.DesignPoint, **plotting_options) None#
 Add a DesignPoint object to the plotter.
- Parameters:
 - design_point
DesignPoint DesignPoint to add.
- design_point
 
- GeometryPlotter.plot_iter(plotting_list: list[Any], name_filter: str = None, **plotting_options) None#
 Add a list of any type of object to the scene.
These types of objects are supported:
Body,Component,list[pv.PolyData],pv.MultiBlock, andSketch.- Parameters:
 
- GeometryPlotter.plot(plottable_object: Any, name_filter: str = None, **plotting_options) None#
 Add a custom mesh to the plotter.
- Parameters:
 - plottable_object
str, default:None Regular expression with the desired name or names you want to include in the plotter.
- name_filter: str, default: None
 Regular expression with the desired name or names you want to include in the plotter.
- **plotting_options
dict, default:None Keyword arguments. For allowable keyword arguments, depend of the backend implementation you are using.
- plottable_object
 
- GeometryPlotter.show(plotting_object: Any = None, screenshot: str | None = None, **plotting_options) None | list[Any]#
 Show the plotter.
- GeometryPlotter.export_glb(plotting_object: Any = None, filename: str | pathlib.Path | None = None, **plotting_options) pathlib.Path#
 Export the design to a glb file. Does not support picked objects.
- Parameters:
 - plotting_object
Any, default:None Object you can add to the plotter.
- filename
str|Path, default:None Path to save a GLB file of the plotter. If None, the file will be saved as temp_glb.glb.
- **plotting_options
dict, default:None Keyword arguments for the plotter. Arguments depend of the backend implementation you are using.
- plotting_object
 - Returns:
 PathPath to the exported glb file.