ModelPlotter#
- class ansys.aedt.core.visualization.plot.pyvista.ModelPlotter#
Manages the data to be plotted with
pyvista
.Examples
This Class can be instantiated within Pyaedt (with plot_model_object or different field plots and standalone). Here an example of standalone project
>>> model = ModelPlotter() >>> model.add_object(r"D:\Simulation\antenna.obj", (200, 20, 255), 0.6, "in") >>> model.add_object(r"D:\Simulation\helix.obj", (0, 255, 0), 0.5, "in") >>> model.add_field_from_file(r"D:\Simulation\helic_antenna.csv", True, "meter", 1) >>> model.background_color = (0, 0, 0) >>> model.plot()
And here an example of animation:
>>> model = ModelPlotter() >>> model.add_object(r"D:\Simulation\antenna.obj", (200, 20, 255), 0.6, "in") >>> model.add_object(r"D:\Simulation\helix.obj", (0, 255, 0), 0.5, "in") >>> frames = [ ... r"D:\Simulation\helic_antenna.csv", ... r"D:\Simulation\helic_antenna_10.fld", ... r"D:\Simulation\helic_antenna_20.fld", ... r"D:\Simulation\helic_antenna_30.fld", ... r"D:\Simulation\helic_antenna_40.fld", ... ] >>> model.gif_file = r"D:\Simulation\animation.gif" >>> model.animate()
Methods
ModelPlotter.add_field_from_data
(...[, ...])Add field data to the scenario.
ModelPlotter.add_field_from_file
(field_path)Add a field file to the scenario.
ModelPlotter.add_frames_from_file
(field_files)Add a field file to the scenario.
ModelPlotter.add_object
(cad_path[, ...])Add a mesh file to the scenario.
ModelPlotter.animate
([show])Animate the current field plot.
Clean downloaded files, and, on demand, also the cached meshes.
Close the render window.
Generate mesh for objects only.
ModelPlotter.plot
([export_image_path, show])Plot the current available Data.
ModelPlotter.point_cloud
([points])Generate point cloud with available objects.
Populate pyvista object with geometry and fields added to the model plotter.
ModelPlotter.set_orientation
([...])Change the plot default orientation.
Attributes
Get/Set the azimuth angle value.
Background color.
Background image.
Get or set the camera position value.
Either if convert the fields before plotting in dB.
Get/Set the elevation angle value.
List of fields object.
Get/Set the camera focal point value.
Frames list for animation.
Enable or disable the default iso view.
Multiply the log value.
List of class objects.
Get/Set the roll angle value.
Field scale.
Get/Set the camera view axis.
Scale plot on X.
Scale plot on Y.
Scale plot on Z.
Get/Set the zoom value.