Increase GRID to 400 for smoother fold ridges, widen X_RANGE and C_RANGE, and reduce D_SCALE to compensate. Also mark the script executable with a shebang. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| .gitignore | ||
| butterfly_catastrophe.py | ||
| butterfly_catastrophe.stl | ||
| CLAUDE.md | ||
| LICENSE | ||
| README.md | ||
Catastrophe
3D-printable STL models of surfaces from catastrophe theory — a branch of mathematics studying how small changes in parameters can cause sudden, discontinuous changes in a system's equilibrium state.
This is a personal, exploratory project rather than a polished library — code and comments are kept up to date, but no API stability or reuse outside this repo should be assumed.
Butterfly catastrophe
butterfly_catastrophe.py generates butterfly_catastrophe.stl, a height-field mesh of the equilibrium manifold for the potential
V(x) = x^6 + a*x^4 + c*x^2 + d*x (a = -3 fixed, b = 0)
Equilibria satisfy dV/dx = 0, which rearranges into a single-valued height field d(x, c), avoiding root-finding or branch-tracking across fold lines. See CLAUDE.md for the full derivation, tuning parameters, and printing notes.
Usage
pip install numpy
python butterfly_catastrophe.py
Output: butterfly_catastrophe.stl, ready to slice and print.
License
GPLv3-or-later — see LICENSE.