brim.utilities.plotting.PlotBrimMixin#

class brim.utilities.plotting.PlotBrimMixin(inertial_frame: ReferenceFrame, zero_point: Point, brim_object: BrimBase)#

Bases: object

Mixin class for plotting BRiM objects.

Attributes

annot_coords

Coordinate where the annotation text is displayed.

plot_objects

Plot objects.

Methods

__init__

Initialize a plot object of the BRiM model.

add_body

Add a sympy body to the scene.

add_frame

Add a sympy ReferenceFrame to the scene.

add_line

Add a sympy Vector to the scene.

add_plot_object

Add a plot object to the scene.

add_point

Add a point to the plotter.

add_vector

Add a sympy Vector to the scene.

get_plot_object

Return the plot_object based on a sympy object.

__init__(inertial_frame: ReferenceFrame, zero_point: Point, brim_object: BrimBase) None#

Initialize a plot object of the BRiM model.

__weakref__#

list of weak references to the object (if defined)

add_body(body, **kwargs)#

Add a sympy body to the scene.

Parameters:
  • body (RigidBody or Particle) – The body that should be plotted.

  • **kwargs (dict, optional) – Kwargs that are parsed to both internally used plot objects.

Returns:

The added plot object.

Return type:

PlotBody

add_frame(frame: ReferenceFrame, origin: Point | Vector | None = None, **kwargs)#

Add a sympy ReferenceFrame to the scene.

Parameters:
  • frame (ReferenceFrame) – The reference frame that should be plotted.

  • origin (Point, Vector, optional) – The origin of the reference frame. Default is the zero_point.

  • **kwargs (dict, optional) – Kwargs that are parsed to plot object.

Returns:

The added plot object.

Return type:

PlotFrame

add_line(points: Iterable[Point | Vector], name: str | None = None, **kwargs)#

Add a sympy Vector to the scene.

Parameters:
  • points (list of Point or Vector) – The points or vectors through which the line should be plotted.

  • name (str, optional) – The name of the line. Default is None.

  • **kwargs – Kwargs that are parsed to plot object.

Returns:

The added plot object.

Return type:

PlotLine

add_plot_object(plot_object: PlotBase)#

Add a plot object to the scene.

Parameters:

plot_object (PlotBase) – The plot object that should be added.

add_point(point: Point, **kwargs) PlotBrimMixin._PlotPoint#

Add a point to the plotter.

Parameters:
  • point (Point) – Point to add.

  • **kwargs – Keyword arguments are passed to symmeplot.plot_objects.PlotPoint.

Returns:

Plot object of the point.

Return type:

PlotPoint

add_vector(vector: Vector, origin: Point | Vector | None = None, **kwargs)#

Add a sympy Vector to the scene.

Parameters:
  • vector (Vector) – The vector that should be plotted with respect to the zero_point.

  • origin (Point, Vector, optional) – The origin of the reference frame. Default is the zero_point.

  • **kwargs (dict, optional) – Kwargs that are parsed to the plot object.

Returns:

The added plot object.

Return type:

PlotVector

property annot_coords#

Coordinate where the annotation text is displayed.

get_plot_object(sympy_object: Any | str) PlotBase | None#

Return the plot_object based on a sympy object.

Explanation

Return the plot_object based on a provided sympy object. For example ReferenceFrame('N') will give the PlotFrame of that reference frame. If the plot_object has not been added it will return None.

Parameters:

sympy_object (Any or str) – SymPy object to search for. If it is a string it will search for the name.

Returns:

Retrieved plot object.

Return type:

PlotBase or None

property plot_objects: tuple[symmeplot.core.plot_base.PlotBase, ...]#

Plot objects.