Module:
sdynpy.core.sdynpy_geometrySource: GitHub
Parent:
pyvistaqt.plotting.BackgroundPlotterParent:
pyvistaqt.plotting.QtInteractorParent:
pyvistaqt.rwi.QVTKRenderWindowInteractorParent:
PyQt5.QtWidgets.QWidgetParent:
PyQt5.QtCore.QObjectParent:
sip.wrapperParent:
PyQt5.QtGui.QPaintDeviceParent:
sip.simplewrapperParent:
pyvista.plotting.plotter.BasePlotterParent:
pyvista.core.utilities.misc._BoundsSizeMixinParent:
pyvista.plotting.picking.PickingHelperParent:
pyvista.plotting.picking.PickingMethodsParent:
pyvista.plotting.picking.PickingInterfaceParent:
pyvista.plotting.widgets.WidgetHelper
Signature¶
class sdynpy.core.sdynpy_geometry.ShapePlotter(geometry, shapes, plot_kwargs, background_plotter_kwargs={'auto_update': 0.01}, undeformed_opacity=0.25, starting_scale=1.0, deformed_opacity=1.0, shape_name='Mode', show_damping=True)Class used to plot animated shapes
Methods¶
| Name | Summary |
|---|---|
__init__ | Create a Shape Plotter object to plot shapes |
add_menu_bar | Adds the menu bar to the BackgroundPlotter |
add_toolbars | Adds toolbars to the BackgroundPlotter |
compute_displacements | Computes displacements to apply to the geometry |
next_shape | Increases the index of the shape being plotted |
play_animation | Starts the animation playing |
prev_shape | Decreases the index of the shape being plotted |
reset_shape | Resets a shape if the value of the current shape is changed |
save_animation | Saves the current shape animation to a file |
save_animation_all_shapes | Helper function to easily save animations for all shapes |
save_animation_from_action | |
select_complex | Adjusts how complex shapes are plotted |
select_loop | |
select_scaling_0p25 | Adjusts the current shape scaling by 0.25x |
select_scaling_0p5 | Adjusts the current shape scaling by 0.5x |
select_scaling_0p8 | Adjusts the current shape scaling by 0.8x |
select_scaling_1 | Resets shape scaling to 1 |
select_scaling_1p25 | Adjusts the current shape scaling by 1.25x |
select_scaling_2p0 | Adjusts the current shape scaling by 2x |
select_scaling_4p0 | Adjusts the current shape scaling by 4x |
select_shape | |
select_speed_0p8 | Adjusts the current animation speed by 0.8 |
select_speed_1 | Resets animation speed to default quantities |
select_speed_1p25 | Adjusts the current animation speed by 1.25 |
show_comment | Shows or hides the shape comment |
stop_animation | Stops the animation from playing |
toggle_undeformed | |
update_shape | Updates the shape that is being plotted |
update_shape_mode | Updates the mode that is being plotted |
__init__¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.__init__(self, geometry, shapes, plot_kwargs, background_plotter_kwargs={'auto_update': 0.01}, undeformed_opacity=0.25, starting_scale=1.0, deformed_opacity=1.0, shape_name='Mode', show_damping=True)Create a Shape Plotter object to plot shapes
Parameters¶
geometry : Geometry Geometry on which the shapes will be plotted
shapes : ShapeArray Shapes to plot on the geometry
plot_kwargs : dict Keyword arguments passed to the Geometry.plot function
background_plotter_kwargs : dict, optional Keyword arguments passed to the BackgroundPlotter constructor. The default is {‘auto_update’:0.01}.
undeformed_opacity : float, optional Opacity of the undeformed geometry. Set to zero for no undeformed geometry. The default is 0.25.
starting_scale : float, optional Starting scale of the shapes on the plot. The default is 1.0.
shape_name : str, optional Name that will be used in the plotter to describe the shape. The default is “Mode”
show_damping : bool, optional Boolean that specifies whether the damping should be displayed in the comment.
add_menu_bar¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.add_menu_bar(self) -> NoneAdds the menu bar to the BackgroundPlotter
add_toolbars¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.add_toolbars(self) -> NoneAdds toolbars to the BackgroundPlotter
compute_displacements¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.compute_displacements(self, compute_scale=True) -> numpy.ndarrayComputes displacements to apply to the geometry
Parameters¶
compute_scale : bool, optional Renormalize the displacement scaling. The default is True.
next_shape¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.next_shape(self) -> NoneIncreases the index of the shape being plotted
play_animation¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.play_animation(self)Starts the animation playing
prev_shape¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.prev_shape(self) -> NoneDecreases the index of the shape being plotted
reset_shape¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.reset_shape(self) -> NoneResets a shape if the value of the current shape is changed
save_animation¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.save_animation(self, filename=None, frames=20, frame_rate=20, individual_images=False)Saves the current shape animation to a file
Parameters¶
filename : str, optional Path to the file being saved. The default is None, which returns the images as an array rather than saves them to a file
frames : int, optional Number of frames in the animation. The default is 20.
frame_rate : float, optional Number of frames per second if the animation is saved to a GIF. The default is 20.
individual_images : bool, optional Boolean to specify whether the images are saved as individual PNG files or a single GIF. The default is False.
Returns¶
imgs : np.ndarray or None Returns array of images if filename is None, otherwise returns None
save_animation_all_shapes¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.save_animation_all_shapes(self, filename_base='Shape_{:}.gif', frames=20, frame_rate=20, individual_images=False)Helper function to easily save animations for all shapes
Parameters¶
filename_base : str, optional Filename that will be passed to the format function to produce the actual file name for each shape. The default is ‘Shape_{:}.gif’.
frames : int, optional Number of frames in the animation. The default is 20.
frame_rate : float, optional Number of frames per second if the animation is saved to a GIF. The default is 20.
individual_images : bool, optional Boolean to specify whether the images are saved as individual PNG files or a single GIF. The default is False.
save_animation_from_action¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.save_animation_from_action(self)select_complex¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_complex(self) -> NoneAdjusts how complex shapes are plotted
select_loop¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_loop(self) -> Noneselect_scaling_0p25¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_0p25(self)Adjusts the current shape scaling by 0.25x
select_scaling_0p5¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_0p5(self)Adjusts the current shape scaling by 0.5x
select_scaling_0p8¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_0p8(self)Adjusts the current shape scaling by 0.8x
select_scaling_1¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_1(self)Resets shape scaling to 1
select_scaling_1p25¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_1p25(self)Adjusts the current shape scaling by 1.25x
select_scaling_2p0¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_2p0(self)Adjusts the current shape scaling by 2x
select_scaling_4p0¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_4p0(self)Adjusts the current shape scaling by 4x
select_shape¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_shape(self) -> Noneselect_speed_0p8¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_speed_0p8(self)Adjusts the current animation speed by 0.8
select_speed_1¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_speed_1(self)Resets animation speed to default quantities
select_speed_1p25¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.select_speed_1p25(self)Adjusts the current animation speed by 1.25
show_comment¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.show_comment(self)Shows or hides the shape comment
stop_animation¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.stop_animation(self)Stops the animation from playing
toggle_undeformed¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.toggle_undeformed(self) -> Noneupdate_shape¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.update_shape(self)Updates the shape that is being plotted
update_shape_mode¶
Source: GitHub
def sdynpy.core.sdynpy_geometry.ShapePlotter.update_shape_mode(self, phase=None)Updates the mode that is being plotted
Parameters¶
phase : float, optional Sets the current phase of the shape. The default is None, which computes the new phase based on the time elapsed.