Level surfaces utilizes the rendering capabilities of the 3D modeling language OpenSCAD to graph any implicit surface as well as level surfaces over time.
-
Add $t to f(x, y, z)
- $t varies from 0 to 1 over the course of the animation
- Example:
- The constant in this function changes from -10 to 10
function f(x, y, z) = pow(x, 2) + pow(y, 2) - pow(z, 2) - 10 + 20 * $t;
- More information about animation in OpenSCAD link
-
Move the camera where you want to be in the animation or use the built in variables to set the camera location
-
Select dump pictures
-
Set fps to 1 at the bottom of the screen
-
Set steps to the number frames you want
-
Wait to complete rendering
- OpenSCAD will output a series of images into the same folder as level-surfaces.scad
- This can take minutes or hours depending on the computer and render quality
-
To turn the images into a gif or video
- Use an online png to gif converter
- Or use ffmpeg with a command similar to:
ffmpeg -framerate 60 -i frame%05d.png video-name.gif
The rendering system uses a Marching Cubes algorithm to take points from the function and translate them to a 3D model. This works by extracting data points from the function and then creating a polygonal mesh field based on the cube's intersections.
Several algorithms for tracing 3D objects exist. These methods (sphere tracing, marching cubes, level set, dual contouring, etc) extract points to express density or orientation of points.