How to setup Gabe's project, Mechanism
Some time ago I got to know this awsome project: https://github.com/gabemorris12/mechanism
MIT | A visual tool to aid engineers with the design process for mechanisms, cams, and gears.
Lately, I just saw that Gabe placed some interesting video about it:
The Mechanism Project with Python
To get started with this python project:
#python -m venv gabe_mechanism_venv #create the venv
python3 -m venv gabe_mechanism_venv #create the venv
#gabe_mechanism_venv\Scripts\activate #activate venv (windows)
source gabe_mechanism_venv/bin/activate #(linux/mac)
Install dependencies with:
pip install -e .
#pip freeze > requirements.txt #generate a txt with the ones you have!
./examples/engine.py
and worked perfectly!I just added this line at the script to get a .gif
rendered:
#ani.save('../animations/engine.mp4', dpi=300)
ani.save('../animations/engine.gif', writer='pillow', fps=30)
So that you can see the engine sample animation working:
As you can guess:
- Bars are represented by red lines
- Acceleration is in orange
- Speed in grey
I exchanged some email with its creator, GabeMorris12.
A visual tool to aid engineers with the design process for mechanisms, cams, and gears.
Creating Docs for the Mechanism Project
For more people to be able to use the fantastic mechanism project…
…I had a look to these projects:
MIT | Differents pages and examples apps built with Astro v4.5, shadcn/ui & react js. Open Source.
git clone https://github.com/mickasmt/astro-nomy
- https://github.com/HYP3R00T/CelestialDocs Which has Search capability implemented!
MIT | Documentation template using Astro and Shadcn
git clone https://github.com/HYP3R00T/CelestialDocs
It requires a couple of adjustment to the basepath
…
- HUGO Theme (with MermaidJS, ChartJS TinaCMS support) https://github.com/onweru/compose
MIT | A Hugo theme for documentation sites.
I followed the installation guide https://composedocs.netlify.app/docs/compose/install-theme/
You have to install vercel and tinacloud app into your github
https://github.com/tinacms/tina-barebones-starter
We are good to go: https://jalcocert.github.io/mechanism/
Conclusions
Its been very helpful to use this:
I created a small slider crank app for motor sport lovers (and with much smaller scope than Gabe’s project)
Simulation of a Slider-Crank mechanism. Powered by Python and DASH.
Why am I so excited about get this project working on my computer?
Well, I dedicated an important part of my life to Mechanical engineering…
…and mechanisms are everywhere.
Making our lifes better thanks to their smart designs and leverage.
Mechanisms are kind of code that “automates” the physical movement logic.
Some example?
The one of the engine I will reserve for another post.
Today is the turn of a Singer Machine!
Recently I also discovered about https://www.divergent3d.com/ which seems to be a very cool application of Mechanical Engineering!
Singer Mechanism
15cm on the bottom 35cm la biela 4cm (x2) crank
FAQ
- What are eigenvectors? The math inside mechanisms.
3D Design
Outro
Created this simple version with python:
And working on the symbolic one: https://github.com/JAlcocerT/MultiBodySystemDynamics-MBSD-
Optimum Gears - https://github.com/JAlcocerT/Private/tree/main/Py_optimum_gears
Car power curve with Python
What Ive learnt with this one
TinaCMS
A headless CMS setup, finally!
All thanks to the HUGO Theme, Compose: https://github.com/onweru/compose/
Its great to see that:
- There is a UI to modify post
- Changes in the UI are captured in the github repository (working both ways!)
- There is CI/CD with Vercel, which is the configured deployment option for the static files