This repository contains Manim animations for a 10-minute teaching demonstration on beam bending, designed for first-year engineering students.
This project creates visualizations that explain:
- Different types of beams (simply supported, cantilever, fixed)
- Basic beam bending principles
- Stress and strain distributions
- Moment diagrams
- Real-world applications
- Python 3.8 or higher
- FFmpeg
- Cairo
- Latex
- xdg-utils
sudo apt-get update
sudo apt-get install xdg-utils
sudo apt-get install texlive texlive-latex-extra texlive-fonts-recommended texlive-science texlive-xetex- Clone this repository:
git clone https://github.com/yourusername/beam-bending-animations.git
cd beam-bending-animations- Installiation
# Create and activate a conda environment
conda env create -f environment.yml
conda activate beam-animationsTo render a specific scene:
manim -qm animations/scenes/intro-scene.py IntroSceneQuality options:
-ql: Low quality (faster rendering)-qm: Medium quality-qh: High quality-qk: 4K quality
To render all animations:
python3 scripts/render-all-script.py -qmTo combine all rendered animations into the final teaching demonstration:
python3 scripts/combine-video-script.py --output teaching_demo.mp4 --sequence video_sequence.txtanimations/: Animation source filesscenes/: Individual animation scenesutils/: Utility functions
assets/: Static resourcesscripts/: Helper scriptsoutput/: Generated animations (not tracked in git)
This repository includes a GitHub Action workflow that automatically renders the beam bending visualization in high definition (4K). The workflow can be triggered in two ways:
- Automatically: Whenever code is pushed to the
mainbranch - Manually: Through the GitHub Actions tab in the repository
The GitHub Action performs the following steps:
- Sets up a Conda environment using the
environment.ymlfile - Installs necessary system dependencies (ffmpeg, LaTeX, etc.)
- Renders all individual animation scenes in 4K quality
- Combines the rendered scenes into the final teaching demonstration video
- Uploads the video as an artifact for download
- Creates a GitHub release with the rendered video (only for pushes to main)
To trigger the workflow manually:
- Go to the "Actions" tab in your GitHub repository
- Select the "Render Beam Bending Visualization" workflow
- Click on the "Run workflow" button
- Select the branch you want to run the workflow on
- Click "Run workflow"
After the workflow completes successfully, you can access the rendered video in two ways:
-
Download as an artifact:
- Go to the completed workflow run
- Scroll to the bottom to find the "Artifacts" section
- Click on "beam-bending-video" to download
-
From GitHub Releases (for pushes to main):
- Go to the "Releases" section of your repository
- Find the latest release
- Download the attached video file
You can customize the workflow by editing the .github/workflows/render-beam-bending.yml file:
- Change the quality of the rendering by modifying the
-qkparameter to-ql(low),-qm(medium), or-qh(high) - Modify the output file name or location
- Add additional steps for further processing or deployment
If the workflow fails, check the following:
- Ensure all dependencies are correctly specified in the
environment.ymlfile - Verify that the scripts are executable and have the correct paths
- Check the workflow logs for specific error messages
- Ensure your repository has sufficient GitHub Actions minutes available
For detailed logs and troubleshooting, click on the specific workflow run in the Actions tab.
This project is licensed under the MIT License - see the LICENSE file for details.