Core’s Plot Objects#
This module contains mixins that can be used to create plot objects with different backends by inheriting from the appropriate mixin and the backend’s PlotBase class.
Classes:
Mixin class adding an origin property to a plot object. |
|
|
Mixin class for plotting a body in 3D. |
|
Mixin class for plotting a ReferenceFrame in 3D. |
|
Mixin class for plotting lines in 3D. |
|
Mixin class for plotting a Point in 3D. |
|
Mixin class for plotting a Vector in 3D. |
- class symmeplot.core.plot_objects.OriginMixin#
Bases:
object
Mixin class adding an origin property to a plot object.
Attributes:
The origin of the object with respect to the zero_point.
- class symmeplot.core.plot_objects.PlotBodyMixin(inertial_frame: ReferenceFrame, zero_point: Point, body: Particle | RigidBody, name: str | None = None)#
Bases:
object
Mixin class for plotting a body in 3D.
Notes
The subclass should instantiate the PlotFrame and PlotPoint objects in the constructor. If the body has a frame, then the PlotFrame should be the second child. The PlotPoint representing the center of mass should always be the first child.
Attributes:
The sympy body, which is being plotted.
PlotFrame used for plotting the reference frame of the body.
PlotPoint used for plotting the center of mass of the body.
- class symmeplot.core.plot_objects.PlotFrameMixin(inertial_frame: ReferenceFrame, zero_point: Point, frame: ReferenceFrame, origin: Point | Vector | None = None, name: str | None = None, scale: float = 0.1)#
Bases:
OriginMixin
Mixin class for plotting a ReferenceFrame in 3D.
Notes
The subclass should instantiate the PlotVector objects in the constructor. The children should be added in the following order: x, y, z.
Attributes:
The sympy ReferenceFrame, which is being plotted.
The origin of the object with respect to the zero_point.
The PlotVectors used to plot the reference frame.
PlotVector used for the unit vector in the x direction.
PlotVector used for the unit vector in the y direction.
PlotVector used for the unit vector in the z direction.
- property frame: ReferenceFrame#
The sympy ReferenceFrame, which is being plotted.
- class symmeplot.core.plot_objects.PlotLineMixin(inertial_frame: ReferenceFrame, zero_point: Point, line: Iterable[Point], name: str | None = None)#
Bases:
object
Mixin class for plotting lines in 3D.
Notes
The subclass should create and add the artist in the constructor.
Methods:
Arguments of the sympy object artist in expression form.
Attributes:
The points that spawn the line.
Coordinate values of the plotted line.
- class symmeplot.core.plot_objects.PlotPointMixin(inertial_frame: ReferenceFrame, zero_point: Point, point: Point, name: str | None = None)#
Bases:
object
Mixin class for plotting a Point in 3D.
Notes
The subclass should create and add the artist in the constructor.
Methods:
Get coordinate of the point as expressions.
Attributes:
The sympy Point, which is being plotted.
Coordinate values of the plotted point.
- class symmeplot.core.plot_objects.PlotVectorMixin(inertial_frame: ReferenceFrame, zero_point: Point, vector: Vector, origin: Point | Vector | None = None, name: str | None = None)#
Bases:
OriginMixin
Mixin class for plotting a Vector in 3D.
Notes
The subclass should create and add the artist in the constructor.
Methods:
Arguments of the sympy object artist in expression form.
Attributes:
The origin of the object with respect to the zero_point.
Coordinate values of the origin of the plotted vector.
The sympy Vector, which is being plotted.
Values of the plotted vector.
- get_sympy_object_exprs() tuple[tuple[Expr, ...], tuple[Expr, ...]] #
Arguments of the sympy object artist in expression form.