GeometryPlotter
#
- class ansys.geometry.core.plotting.plotter.GeometryPlotter(use_trame: bool | None = None, allow_picking: bool | None = False, show_plane: bool = True)#
Bases:
ansys.tools.visualization_interface.Plotter
Plotter for PyAnsys Geometry objects.
This class is an implementation of the PlotterInterface class.
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 component to the scene. |
|
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. |
Import detail#
from ansys.geometry.core.plotting.plotter import GeometryPlotter
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.Plane
function for customizing the mesh representing the plane.- plotting_options
dict
, default:None
dictionary containing parameters accepted by the
Plotter.add_mesh
method 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_mesh
method.
- 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_mesh
method.
- 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_mesh
method.
- body
- 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_mesh
method.
- component
- 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_mesh
method.
- 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