file_path stringlengths 32 71 | content stringlengths 0 7.98k |
|---|---|
manim-physics_Matheart/.readthedocs.yml | version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
apt_packages:
- libpango1.0-dev
- ffmpeg
- graphviz
python:
install:
- requirements: docs/rtd-requirements.txt
- requirements: docs/requirements.txt
- method: pip
path: .
|
manim-physics_Matheart/README.md | # manim-physics
## Introduction
This is a 2D physics simulation plugin that allows you to generate complicated
scenes in various branches of Physics such as rigid mechanics,
electromagnetism, wave etc. **Due to some reason, I (Matheart) may not have
time to maintain this repo, if you want to contribute please seek hel... |
manim-physics_Matheart/example.py | from manim_physics import *
class MagneticFieldExample(ThreeDScene):
def construct(self):
wire = Wire(Circle(2).rotate(PI / 2, UP))
mag_field = MagneticField(wire)
self.set_camera_orientation(PI / 3, PI / 4)
self.add(wire, mag_field)
|
manim-physics_Matheart/.github/workflows/ci.yml | name: CI
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
env:
DISPLAY: :0
PYTEST_ADDOPTS: "--color=yes" # colors in pytest
strategy:
fail-fast: fa... |
manim-physics_Matheart/manim_physics/__init__.py | __version__ = "0.2.3"
from manim import *
from .electromagnetism.electrostatics import *
from .electromagnetism.magnetostatics import *
from .optics.lenses import *
from .optics.rays import *
from .rigid_mechanics.pendulum import *
from .rigid_mechanics.rigid_mechanics import *
from .wave import *
|
manim-physics_Matheart/manim_physics/wave.py | """3D and 2D Waves module."""
from __future__ import annotations
from typing import Iterable, Optional
from manim import *
__all__ = [
"LinearWave",
"RadialWave",
"StandingWave",
]
try:
# For manim < 0.15.0
from manim.mobject.opengl_compatibility import ConvertToOpenGL
except ModuleNotFoundErro... |
manim-physics_Matheart/manim_physics/optics/__init__.py | """A lensing module.
Currently only shows refraction in lenses and not
total internal reflection.
"""
|
manim-physics_Matheart/manim_physics/optics/rays.py | """Rays of light. Refracted by Lenses."""
from __future__ import annotations
from typing import Iterable
from manim import config
from manim.mobject.geometry.line import Line
from manim.utils.space_ops import angle_of_vector, rotate_vector
import numpy as np
from .lenses import Lens, antisnell, intersection, snell
... |
manim-physics_Matheart/manim_physics/optics/lenses.py | """Lenses for refracting Rays.
"""
from __future__ import annotations
from typing import Iterable, Tuple
from manim import config
from manim.constants import LEFT, RIGHT
from manim.mobject.geometry.arc import Circle
from manim.mobject.geometry.boolean_ops import Difference, Intersection
from manim.mobject.geometry.pol... |
manim-physics_Matheart/manim_physics/electromagnetism/magnetostatics.py | """Magnetostatics module"""
from __future__ import annotations
import itertools as it
from typing import Iterable, Tuple
from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL
from manim.mobject.types.vectorized_mobject import VMobject
from manim.mobject.vector_field import ArrowVectorField
import nump... |
manim-physics_Matheart/manim_physics/electromagnetism/__init__.py | |
manim-physics_Matheart/manim_physics/electromagnetism/electrostatics.py | """Electrostatics module"""
from __future__ import annotations
from typing import Iterable
from manim import normalize
from manim.constants import ORIGIN, TAU
from manim.mobject.geometry.arc import Arc, Dot
from manim.mobject.geometry.polygram import Rectangle
from manim.mobject.types.vectorized_mobject import VGroup... |
manim-physics_Matheart/manim_physics/rigid_mechanics/pendulum.py | r"""Pendulums.
:class:`~MultiPendulum` and :class:`~Pendulum` both stem from the
:py:mod:`~rigid_mechanics` feature.
"""
from __future__ import annotations
from typing import Iterable
from manim.constants import DOWN, RIGHT, UP
from manim.mobject.geometry.arc import Circle
from manim.mobject.geometry.line import Li... |
manim-physics_Matheart/manim_physics/rigid_mechanics/__init__.py | |
manim-physics_Matheart/manim_physics/rigid_mechanics/rigid_mechanics.py | """A gravity simulation space.
Most objects can be made into a rigid body (moves according to gravity
and collision) or a static body (stays still within the scene).
To use this feature, the :class:`~SpaceScene` must be used, to access
the specific functions of the space.
.. note::
* This feature utilizes the ... |
manim-physics_Matheart/tests/test_lensing.py | __module_test__ = "optics"
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
from manim_physics import *
@frames_comparison
def test_rays_lens(scene):
lens_style = {"fill_opacity": 0.5, "color": BLUE}
a = Lens(-100, 1, **lens_style).shift(LEFT)
a2 = Lens(100, 1, **le... |
manim-physics_Matheart/tests/conftest.py | from __future__ import annotations
import sys
from pathlib import Path
import pytest
from manim import config, tempconfig
def pytest_addoption(parser):
parser.addoption(
"--skip_slow",
action="store_true",
default=False,
help="Will skip all the slow marked tests. Slow tests are ... |
manim-physics_Matheart/tests/__init__.py | |
manim-physics_Matheart/tests/test_rigid_mechanics.py | __module_test__ = "rigid_mechanics"
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
from manim_physics.rigid_mechanics.rigid_mechanics import *
@frames_comparison(base_scene=SpaceScene)
def test_rigid_mechanics(scene):
circle = Circle().shift(UP)
circle.set_fill(RED, ... |
manim-physics_Matheart/tests/test_electromagnetism.py | __module_test__ = "electromagnetism"
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
from manim_physics.electromagnetism.electrostatics import *
from manim_physics.electromagnetism.magnetostatics import *
@frames_comparison
def test_electric_field(scene):
charge1 = Charge... |
manim-physics_Matheart/tests/test_wave.py | __module_test__ = "waves"
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
from manim_physics.wave import *
@frames_comparison()
def test_linearwave(scene):
wave = LinearWave()
wave.set_time(2)
scene.add(wave)
@frames_comparison()
def test_radialwave(scene):
... |
manim-physics_Matheart/tests/test_pendulum.py | __module_test__ = "pendulum"
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
from manim_physics.rigid_mechanics.pendulum import *
@frames_comparison(base_scene=SpaceScene)
def test_pendulum(scene: SpaceScene):
pends = VGroup(*[Pendulum(i) for i in np.linspace(1, 5, 7)])
... |
manim-physics_Matheart/docs/source/changelog.rst | =========
Changelog
=========
**v0.3.0**
==========
Breaking Changes
----------------
- Huge library refactor.
- :class:`~.MagneticField` now takes a :class:`~.Wire` parameter. This allows
for a 3D field.
- Optimized field functions for both :class:`~.ElectricField` and
:class:`~.MagneticField`.
**v0.2.5... |
manim-physics_Matheart/docs/source/contributing.rst | Contributing
============
Contributions are welcome! The repository owner (Matheart) might not be
available, any pull requests or issues will be attended by other developers.
There's three parts in a contribution:
1. The proposed addition/improvement.
2. Documentation for the new addition.
3. Tests for the addition.... |
manim-physics_Matheart/docs/source/reference.rst | Reference
---------
.. toctree::
:maxdepth: 2
reference_index/electromagnetism
reference_index/optics
reference_index/rigid_mechanics
reference_index/wave
|
manim-physics_Matheart/docs/source/index.rst | Manim Physics
-------------
Welcome to the `manim-physics` official documentation!
Installation
++++++++++++
``manim-physics`` is a package on pypi, and can be directly installed using
pip:
.. code-block:: powershell
pip install manim-physics
.. warning::
Please do not directly clone the github repo! The r... |
manim-physics_Matheart/docs/source/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from __future__ import annotations
import os
import sys
import manim_physics
# -- Pa... |
manim-physics_Matheart/docs/source/reference_index/rigid_mechanics.rst | Rigid Mechanics
---------------
.. currentmodule:: manim_physics
.. autosummary::
:toctree: ../reference
~rigid_mechanics.rigid_mechanics
~rigid_mechanics.pendulum
|
manim-physics_Matheart/docs/source/reference_index/electromagnetism.rst | Electromagnetism
================
.. currentmodule:: manim_physics
.. autosummary::
:toctree: ../reference
~electromagnetism.electrostatics
~electromagnetism.magnetostatics
|
manim-physics_Matheart/docs/source/reference_index/optics.rst | Optics
------
.. currentmodule:: manim_physics
.. autosummary::
:toctree: ../reference
~optics.lenses
~optics.rays
|
manim-physics_Matheart/docs/source/reference_index/wave.rst | Waves
========
.. currentmodule:: manim_physics
.. autosummary::
:toctree: ../reference
~wave
|
manim-physics_Matheart/docs/source/_templates/autosummary/class.rst | {{ name | escape | underline}}
Qualified name: ``{{ fullname | escape }}``
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
:show-inheritance:
:members:
{% block methods %}
{%- if methods %}
.. rubric:: {{ _('Methods') }}
.. autosummary::
:nosignatures:
{% for item in meth... |
manim-physics_Matheart/docs/source/_templates/autosummary/module.rst | {{ name | escape | underline }}
.. currentmodule:: {{ fullname }}
.. automodule:: {{ fullname }}
{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes
.. autosummary::
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block class... |
README.md exists but content is empty.
- Downloads last month
- 49