This is a slightly modified repository of Will Morrisons Marble Fountain project that should run under Windows.
I was able to run it several times in Win11 on a 12600H cpu - a 250x250x250 sized run with 6 tracks took just under 119 hours. OpenSCAD appears to only run single-threaded. If I could figure out how to run it multi-threaded it would speed up immensely.
Requirements: I used python v3.13.5 - the idea is to use a stable release. Once you have that, the python code requires the following modules: scipy, matplotlib, solidpython2, stl, numpy-stl --- note: (numpy-stl was only required in windows, under linux it didnt seem to be needed )
I installed them using "pip" which should be obvious, but in a cmd window: pip install scipy pip install matplotlib pip install solidpython2 pip install stl pip install numpy-stl
You also need OpenSCAD from https://openscad.org/downloads.html - I installed the 64-bit version for windows Make sure you can type/paste "\progra~1\openscad\openscad --help" in a command-line once it is installed, or you will have to fix the path in MakeSTLs.py to the proper location for openscad.exe!
Original README follows (more or less):
This is a repository of code to procedurally generate large complex organic marble runs.
This codebase is super bodged together and I give no garuntees of y'all being able to anything working. The whole thing desperately needs a massive cleanup and I am way outside the level of complexity that OpenSCAD is the best tool for. If I do take the time to refactor I'm likely going to do a substantial rewrite and use a different tool for mesh generation.
I am leaving the door open to selling sculptures generated by this system and thus this repo is intended more as an interesting reference than an open-source project. That said, if I saw this project online I would want to be able to see how it works, so I figured folks would prefer that I share it as is than not at all.
Run full generation in one line python newPath.py output/ SOLVE && python pathGen.py && python modelGen.py && python makeSTLs.py
python newPath.py output/ SOLVE re-initializes the paths
python pathGen.py runs the solver
python modelGen.py generates track and support geometry into scad files
python makeSTLs.py generates stls from scad files
While pathGen.py runs python3 shared.py will plot the paths as they are solved
defs.py defines a ton of static variables for configuring the generation, some of which have comments
animate_generation.py generates animations of the generation running by repeatedly opening OpenSCAD.appimage which is very slow
This only runs on Linux (WSL should work) -- (no longer true - makeSTLS modified to run OpenSCAD in windows - check path)
The screw and base are sized to fit a nema 17 stepper motor glued onto the base
Everything is tuned around 1/4" ball bearings and you may need to retune things for anything else
makeSTLs.py assumes you have OpenSCAD at ~/install/OpenSCAD.AppImage
Some of the random knobs in defs.py have not been touched in over a year and I don't remember what they do
This code is extremely poorly optimized. I'm not even using KD trees for point collision. I have been much more focused on the output than how long it took to converge.
This is published under a non-commercial license. Do not sell the code, exported models, or any objects manufactured using this tool.
I have only tested printing this on the Form4 & Form4L.