mirror of
https://git.ludikovsky.name/git/scad-gen.git
synced 2026-11-17 06:20:18 +00:00
No description
- Ruby 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| LICENSE.txt | ||
| README.md | ||
| scad-gen.rb | ||
scad-gen
Generate OpenSCAD files for visualizations of arbitrary functions.
WHY?!
Why not?
I wanted to be able to generate 3D models of various mathematical functions after seeing this Tweet by @nwilliams030
How?
This is one simple Ruby script. At the top are the only things you need to edit:
t: the starting input value for your function (f(0))step: the stepping between function valuestmax: the end valuecalc(t): your function, expected to return an array with (x,y,z)
The main loop iterates from t to tmax at step increments,
calculates the function calc at each step, and draws cylinders between
the points, with a sphere at each point (for a smoother appearance).
After setting it all up, run the script, sending the output to a target file. Open in OpenSCAD, render, voilà.