ModelPlotter#

class pyaedt.modules.AdvancedPostProcessing.ModelPlotter[source]#

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()

Animate the current field plot.

ModelPlotter.clean_cache_and_files([...])

Clean downloaded files, and, on demand, also the cached meshes.

ModelPlotter.generate_geometry_mesh()

Generate mesh for objects only.

ModelPlotter.plot([export_image_path, show])

Plot the current available Data.

ModelPlotter.set_orientation([...])

Change the plot default orientation.

Attributes

ModelPlotter.azimuth_angle

Get/Set the azimuth angle value.

ModelPlotter.background_color

Background color.

ModelPlotter.background_image

Background image.

ModelPlotter.camera_position

Get or set the camera position value.

ModelPlotter.convert_fields_in_db

Either if convert the fields before plotting in dB.

ModelPlotter.elevation_angle

Get/Set the elevation angle value.

ModelPlotter.fields

List of fields object.

ModelPlotter.focal_point

Get/Set the camera focal point value.

ModelPlotter.frames

Frames list for animation.

ModelPlotter.isometric_view

Enable or disable the default iso view.

ModelPlotter.log_multiplier

Multiply the log value.

ModelPlotter.objects

List of class objects.

ModelPlotter.roll_angle

Get/Set the roll angle value.

ModelPlotter.view_up

Get/Set the camera view axis.

ModelPlotter.x_scale

Scale plot on X.

ModelPlotter.y_scale

Scale plot on Y.

ModelPlotter.z_scale

Scale plot on Z.

ModelPlotter.zoom

Get/Set the zoom value.