-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c292c89
Showing
72 changed files
with
15,927 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 55442ba78287e8cf3d38f68df889caaa | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Core's Artists | ||
============== | ||
|
||
.. automodule:: symmeplot.core.artists | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SymMePlot Core | ||
============== | ||
|
||
This is the core of the SymMePlot project. It contains the core classes from which the | ||
different visualization backends are derived. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
scene | ||
plot_objects | ||
plot_base | ||
artists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Core's PlotBase | ||
=============== | ||
|
||
.. automodule:: symmeplot.core.plot_base | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
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. | ||
|
||
.. automodule:: symmeplot.core.plot_objects | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Core's Scene | ||
============ | ||
|
||
.. automodule:: symmeplot.core.scene | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
API Reference | ||
============= | ||
|
||
This is the API reference for the `symmeplot` package. The package has separate | ||
subpackages for each backend. The backends are: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
matplotlib/index | ||
pyqtgraph/index | ||
|
||
Each of these backends is derived from the `symmeplot.core` package: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
core/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Matplotlib's Artists | ||
==================== | ||
|
||
.. automodule:: symmeplot.matplotlib.artists | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
SymMePlot Matplotlib | ||
==================== | ||
|
||
Matplotlib backend of SymMePlot. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
scene | ||
plot_objects | ||
plot_base | ||
artists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Matplotlib's PlotBase | ||
===================== | ||
|
||
.. automodule:: symmeplot.matplotlib.plot_base | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Matplotlib's Plot Objects | ||
========================= | ||
|
||
.. automodule:: symmeplot.matplotlib.plot_objects | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Matplotlib's Scene | ||
================== | ||
|
||
.. automodule:: symmeplot.matplotlib.scene | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Pyqtgraph's Artists | ||
=================== | ||
|
||
.. automodule:: symmeplot.pyqtgraph.artists | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
SymMePlot Pyqtgraph | ||
=================== | ||
|
||
Pyqtgraph backend of SymMePlot. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
scene | ||
plot_objects | ||
plot_base | ||
artists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Pyqtgraph's PlotBase | ||
==================== | ||
|
||
.. automodule:: symmeplot.pyqtgraph.plot_base | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Pyqtgraph's Plot Objects | ||
========================= | ||
|
||
.. automodule:: symmeplot.pyqtgraph.plot_objects | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Pyqtgraph's Scene | ||
================= | ||
|
||
.. automodule:: symmeplot.pyqtgraph.scene | ||
:members: | ||
:show-inheritance: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Installation | ||
============ | ||
|
||
Installation Users | ||
------------------ | ||
|
||
SymMePlot is available on both PyPI and Conda-Forge. To install the latest release from | ||
PyPI, run: :: | ||
|
||
pip install symmeplot | ||
|
||
To use the `matplotlib`_ backend, you’ll need to install `matplotlib`_ as well: :: | ||
|
||
pip install matplotlib | ||
|
||
To use the `pyqtgraph`_ backend, you’ll need to install `pyqtgraph`_ with some optional | ||
dependencies as well: :: | ||
|
||
pip install pyqtgraph pyopengl pyqt6 | ||
|
||
Installation Developers | ||
----------------------- | ||
SymMePlot uses `poetry`_ as package manager. To install SymMePlot after installing | ||
`poetry`_ and cloning the repository, run: :: | ||
|
||
poetry install | ||
|
||
SymMePlot offers dependency groups to assist developers: | ||
|
||
- ``lint``: packages required for linting. | ||
- ``test``: packages required for testing. | ||
- ``docs``: packages required for building the documentation. | ||
|
||
To install optional dependencies from a specific group, run: :: | ||
|
||
poetry install --with <group> | ||
|
||
The backends are optional dependencies. These can be installed using: :: | ||
|
||
poetry install --extras mpl_backend | ||
poetry install --extras pg_backend | ||
|
||
To install everything at once, run: :: | ||
|
||
poetry install --with lint,test,docs --all-extras | ||
|
||
To quickly check code for linting errors, it is recommended to set up ``pre-commit`` | ||
hooks by executing: :: | ||
|
||
pre-commit install | ||
|
||
.. _poetry: https://python-poetry.org | ||
.. _matplotlib: https://matplotlib.org | ||
.. _pyqtgraph: https://www.pyqtgraph.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Welcome to symmeplot's documentation! | ||
===================================== | ||
|
||
SymMePlot is a visualization tool designed for mechanical systems created using the | ||
mechanics module in SymPy_, :mod:`sympy.physics.mechanics`. | ||
|
||
The :mod:`sympy.physics.mechanics` module allows users to define mechanical systems | ||
symbolically to derive their analytic equations of motion. During this process, users | ||
can construct various objects such as reference frames, points, bodies, and more. | ||
|
||
SymMePlot enhances this process by providing a way to visualize these constructed | ||
objects. It integrates with visualization backends like Matplotlib_, and creates visual | ||
representations based on the parametrization of the symbols involved in the system. | ||
|
||
To install :mod:`symmeplot` with the :mod:`matplotlib` visualization run: :: | ||
|
||
pip install symmeplot matplotlib | ||
|
||
Most of your programs are expected to follow this structure: | ||
|
||
1. Creation of the system in sympy using the objects from | ||
:mod:`sympy.physics.mechanics`. | ||
2. Create a figure with a 3D axes with :mod:`matplotlib`. | ||
3. Initiate a :class:`Scene<symmeplot.matplotlib.scene.Scene3D>` with the inertial frame | ||
and absolute origin. | ||
4. Add your frames, vectors and points to the plotter instance. | ||
5. Lambdify and evaluate the system. | ||
6. Plot the system. | ||
|
||
Here is a simple example of how it looks in practice: :: | ||
|
||
import numpy as np | ||
from symmeplot.matplotlib import Scene3D | ||
from sympy.physics.mechanics import Point, ReferenceFrame, dynamicsymbols | ||
|
||
# Create the system in sympy | ||
N = ReferenceFrame("N") | ||
A = ReferenceFrame("A") | ||
q = dynamicsymbols("q") | ||
A.orient_axis(N, N.z, q) | ||
N0 = Point("N_0") | ||
v = 0.2 * N.x + 0.2 * N.y + 0.7 * N.z | ||
A0 = N0.locatenew("A_0", v) | ||
# Create the instance of the scene specifying the inertial frame and origin | ||
scene = Scene3D(N, N0, scale=0.5) | ||
# Add the objects to the system | ||
scene.add_vector(v) | ||
scene.add_frame(A, A0, ls="--") | ||
scene.add_point(A0, color="g") | ||
# Evaluate the system. | ||
scene.lambdify_system(q) | ||
scene.evaluate_system(0.5) | ||
# Plot the system | ||
scene.plot() | ||
|
||
# You can also animate this system. | ||
ani = scene.animate(lambda q: (q,), frames=np.linspace(0, 2 * np.pi, 60)) | ||
ani.save("animation.gif", fps=30) | ||
|
||
.. image:: animation.gif | ||
:alt: animation | ||
:align: center | ||
|
||
To convert the plot to a 2D variant, at the following line before `scene.plot()`: :: | ||
|
||
scene.as_orthogonal_projection_plot() | ||
|
||
.. image:: animation_2d.gif | ||
:alt: animation | ||
:align: center | ||
|
||
Contents | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
guides/installation | ||
api/index | ||
|
||
.. _SymPy: https://www.sympy.org | ||
.. _Matplotlib: https://matplotlib.org/ |
Oops, something went wrong.