Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sdynpy.core.sdynpy_geometry.ShapePlotter

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

NameSummary
__init__Create a Shape Plotter object to plot shapes
add_menu_barAdds the menu bar to the BackgroundPlotter
add_toolbarsAdds toolbars to the BackgroundPlotter
compute_displacementsComputes displacements to apply to the geometry
next_shapeIncreases the index of the shape being plotted
play_animationStarts the animation playing
prev_shapeDecreases the index of the shape being plotted
reset_shapeResets a shape if the value of the current shape is changed
save_animationSaves the current shape animation to a file
save_animation_all_shapesHelper function to easily save animations for all shapes
save_animation_from_action
select_complexAdjusts how complex shapes are plotted
select_loop
select_scaling_0p25Adjusts the current shape scaling by 0.25x
select_scaling_0p5Adjusts the current shape scaling by 0.5x
select_scaling_0p8Adjusts the current shape scaling by 0.8x
select_scaling_1Resets shape scaling to 1
select_scaling_1p25Adjusts the current shape scaling by 1.25x
select_scaling_2p0Adjusts the current shape scaling by 2x
select_scaling_4p0Adjusts the current shape scaling by 4x
select_shape
select_speed_0p8Adjusts the current animation speed by 0.8
select_speed_1Resets animation speed to default quantities
select_speed_1p25Adjusts the current animation speed by 1.25
show_commentShows or hides the shape comment
stop_animationStops the animation from playing
toggle_undeformed
update_shapeUpdates the shape that is being plotted
update_shape_modeUpdates the mode that is being plotted

__init__

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

add_menu_bar

def sdynpy.core.sdynpy_geometry.ShapePlotter.add_menu_bar(self) -> None

Adds the menu bar to the BackgroundPlotter

add_toolbars

def sdynpy.core.sdynpy_geometry.ShapePlotter.add_toolbars(self) -> None

Adds toolbars to the BackgroundPlotter

compute_displacements

def sdynpy.core.sdynpy_geometry.ShapePlotter.compute_displacements(self, compute_scale=True) -> numpy.ndarray

Computes displacements to apply to the geometry

Parameters

next_shape

def sdynpy.core.sdynpy_geometry.ShapePlotter.next_shape(self) -> None

Increases the index of the shape being plotted

play_animation

def sdynpy.core.sdynpy_geometry.ShapePlotter.play_animation(self)

Starts the animation playing

prev_shape

def sdynpy.core.sdynpy_geometry.ShapePlotter.prev_shape(self) -> None

Decreases the index of the shape being plotted

reset_shape

def sdynpy.core.sdynpy_geometry.ShapePlotter.reset_shape(self) -> None

Resets a shape if the value of the current shape is changed

save_animation

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

Returns

save_animation_all_shapes

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

save_animation_from_action

def sdynpy.core.sdynpy_geometry.ShapePlotter.save_animation_from_action(self)

select_complex

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_complex(self) -> None

Adjusts how complex shapes are plotted

select_loop

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_loop(self) -> None

select_scaling_0p25

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_0p25(self)

Adjusts the current shape scaling by 0.25x

select_scaling_0p5

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_0p5(self)

Adjusts the current shape scaling by 0.5x

select_scaling_0p8

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_0p8(self)

Adjusts the current shape scaling by 0.8x

select_scaling_1

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_1(self)

Resets shape scaling to 1

select_scaling_1p25

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_1p25(self)

Adjusts the current shape scaling by 1.25x

select_scaling_2p0

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_2p0(self)

Adjusts the current shape scaling by 2x

select_scaling_4p0

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_scaling_4p0(self)

Adjusts the current shape scaling by 4x

select_shape

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_shape(self) -> None

select_speed_0p8

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_speed_0p8(self)

Adjusts the current animation speed by 0.8

select_speed_1

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_speed_1(self)

Resets animation speed to default quantities

select_speed_1p25

def sdynpy.core.sdynpy_geometry.ShapePlotter.select_speed_1p25(self)

Adjusts the current animation speed by 1.25

show_comment

def sdynpy.core.sdynpy_geometry.ShapePlotter.show_comment(self)

Shows or hides the shape comment

stop_animation

def sdynpy.core.sdynpy_geometry.ShapePlotter.stop_animation(self)

Stops the animation from playing

toggle_undeformed

def sdynpy.core.sdynpy_geometry.ShapePlotter.toggle_undeformed(self) -> None

update_shape

def sdynpy.core.sdynpy_geometry.ShapePlotter.update_shape(self)

Updates the shape that is being plotted

update_shape_mode

def sdynpy.core.sdynpy_geometry.ShapePlotter.update_shape_mode(self, phase=None)

Updates the mode that is being plotted

Parameters