Engineer creates 3D-printed marble fountain using procedural generation

Cal Jeffrey

Posts: 4,595   +1,682
Staff member
What the heck is that? Marble Fountain is a piece of "tech art" that looks like a huge tangled mess of string. However, flip a switch and ball bearings trickle forth, each riding one of eight complicated tracks to the bottom of the sculpture before being conveyed to the top again by a ball screw. It is mesmerizing to watch.

We've all seen marble runs before, but they are usually handmade with only a few tracks at most. However, mechatronics engineer Will Morrison wanted to kick it up a notch, so he devised an algorithm that used procedural generation to draw the splines of its eight tracks. He thought it was going to be a simple weekend project, but he quickly got swept up in a multi-month design fest.

"I started this just planning for the janky splines as a weekend project, but it has gotten thoroughly out of hand," Morrison wrote in his blog last week.

The twisting tower of tracks is a fully 3D-printed marble run, worthy of display in an art gallery. In fact, when Morrison applied to show it in the New Alliance Gallery in Somerville, Massachusetts, the curator eagerly accepted.

Morrison partly blames his place of employment for the project's ballooning scope. He had recently begun work as a systems integration engineer at a lab with some of the best and biggest 3D printers money could buy.

"After starting work at Formlabs in September of 2023 and gaining access to much nicer printers than I was used to, I started wanting to tackle some large algorithmic structure projects," he said.

His goal was to create a run that took up as much available print space as possible. He began by having a script drop random points through a virtual print volume, then connecting those points with splines to form paths in OpenSCAD. Each path maintained a constant downward slope so that a steel ball could roll from top to bottom without stopping. The early results worked – but they were too simple. So he wrote a solver to create multiple paths that would fill every bit of printable space while staying functional.

The solver follows a strict set of rules. The tracks must stay within bounds, keep even spacing, maintain minimum and maximum turning radii, and keep a constant slope. Each segment of track repels others to prevent collisions, smooths out slope changes to avoid jumps, and constantly adjusts itself to keep the balls moving. What emerges from these constraints is a kind of controlled chaos – a web of interlocking curves that feels more organic than artificial.

Keeping the marbles moving smoothly turned out to be more challenging than generating the tracks. Straight sections would let the marbles accelerate too much, while slow turns drained their momentum. The solution Morrison came up with was counterintuitive. He made the paths snake constantly and bank aggressively, keeping the ball speed under control.

Morrison said he got burned out after some 65 iterations. However, he might revise and refine the algorithm in a future side project.

"This was the most work I have ever put into a hobby project," he said. "The final models take around 5-20 minutes to export. I have vague ambitions to do a big rewrite eventually but figured sharing janky code is better than none."

Those interested can find his code on GitHub.

Permalink to story:

 
I'm designing a lid that will be somewhat universal for various sized vases that will hold up a lamp shade and an LED light on top of the vase, so the vase can be used as a mini aquarium/fish bowl. The LED light can support plants, so the vase becomes what's know as a "Walstad vase" or a mini aquarium that is meant to be low-maintenance/self sustaining.

Printing out prototypes right now.
 
You wonder how long it be till you can ask an AI to create and print such things. And what would you ask for?
 
You wonder how long it be till you can ask an AI to create and print such things. And what would you ask for?
Not until AI understands physics; which an LLM can't, since it is only a word-association algorithm at the end of the day.

I'm sure generative AI could make a render that looks like it would work. It could maybe even get to the point of generating something that could be physically printed. But as the creator pointed out: controlling the ball bearing speed proved difficult. We've also seen what AI does when you ask it to generate code, when you go that route, if you were to try to have it generate an algorithm that could generate marble fountains like this; I wouldn't expect that code to ever produce consistently functional marble runs.
 
Not until AI understands physics; which an LLM can't, since it is only a word-association algorithm at the end of the day.
LLM's seem to be pretty good at understanding language and art and even video. I believe they're also being put to work on mathematical formulas to look for errors. I'm not certain that understanding physics is that much of a jump.

But as the creator pointed out: controlling the ball bearing speed proved difficult. We've also seen what AI does when you ask it to generate code, when you go that route, if you were to try to have it generate an algorithm that could generate marble fountains like this; I wouldn't expect that code to ever produce consistently functional marble runs.
I'm no expert but I'd of thought the ball speed would just be dependant on the slope. If I was coding it, as opposed to trying to get an LLM to work it out, I'd design a few different lengths of track with various curves and passing points and these would be the building blocks for the marble run. Then I'd try joining different building blocks together and have a scoring algorithm to award points for tracks that start at the same rough place, that get to the bottom without colliding, the overall shape of the complete structure and perhaps a constant speed for the ball. It doesn't seem like rocket science. Maybe even get the algorithm to try out different designs of building block and see what it comes up with.
 
LLM's seem to be pretty good at understanding language and art and even video.
Maybe if you have a layman's understanding of that art.
I believe they're also being put to work on mathematical formulas to look for errors. I'm not certain that understanding physics is that much of a jump.
"Source: I made it up"
Because I worked with generative AI back in grad school in 2018-2022, and I don't think I ever came across a single paper that proved LLMs could be "put to work on mathematical formulas" with any reliability. Pray tell: is this work on novel proofs, or did someone just decide to make a really inefficient Matlab toolbox, or Pandas competitor, with questionable outputs?

I'm no expert but I'd of thought the ball speed would just be dependant on the slope. If I was coding it, as opposed to trying to get an LLM to work it out, I'd design a few different lengths of track with various curves and passing points and these would be the building blocks for the marble run. Then I'd try joining different building blocks together and have a scoring algorithm to award points for tracks that start at the same rough place, that get to the bottom without colliding, the overall shape of the complete structure and perhaps a constant speed for the ball. It doesn't seem like rocket science. Maybe even get the algorithm to try out different designs of building block and see what it comes up with.
Slope... and static friction, dynamic friction, rolling friction, radii of the curves in the tracks, tracking potential energy and kinetic energy since you can see the slopes aren't constant throughout any of the individual runs. And this is before you get into the physics of actually printing the thing, so now it needs to consider bridge length & strength; sagging materials under both load and during printing; support planning; etc.
 
Maybe if you have a layman's understanding of that art.
(regards me stating that LLM's seem pretty good at understanding language, art and video) For language I use google translate all the time as does my wife even though she's fluent in French and Spanish. For art: The piece “Théâtre D'opéra Spatial” took first place in an American art show but later turned out to be AI generated. Most of the artwork for TS articles also appears to be AI generated. For video: I was watching a video on YT just today ("AI Interviews Americans at Walmart") that was AI generated (and definitely NSFW) - in all honesty, I couldn't tell it was AI generated. Ironically, there's a new TS article entitled "This AI country singer just became Billboard's number one" which goes further to prove my point.

"Source: I made it up"
Because I worked with generative AI back in grad school in 2018-2022, and I don't think I ever came across a single paper that proved LLMs could be "put to work on mathematical formulas" with any reliability. Pray tell: is this work on novel proofs, or did someone just decide to make a really inefficient Matlab toolbox, or Pandas competitor, with questionable outputs?
Only last month AI made a big break through on the "previously impossible" Navier Stokes equations. Nature magazine did an article a few years back called "Mathematical discovery in the age of artificial intelligence" which you might find interesting. Google are working on AlphaEvolve, AlphaGeometry and AlphaProof for mathematics. They're still being developed but they're based on the self learning LLM's like AlphaGo (world champion Go player) and AlphaZero (which became world chess champion after studying chess for only 4 hours).

Slope... and static friction, dynamic friction, rolling friction, radii of the curves in the tracks, tracking potential energy and kinetic energy since you can see the slopes aren't constant throughout any of the individual runs. And this is before you get into the physics of actually printing the thing, so now it needs to consider bridge length & strength; sagging materials under both load and during printing; support planning; etc.
I'm sure there are lot's of minor effects that affect the speed (you left off air pressure and temperature) but all these are minimal compared to the slope. If the ball timing is that essential to a "waterfall" then perhaps he should use a microcontroller to time the release of balls.
 
Last edited:
(regards me stating that LLM's seem pretty good at understanding language, art and video) For language I use google translate all the time as does my wife even though she's fluent in French and Spanish. For art: The piece “Théâtre D'opéra Spatial” took first place in an American art show but later turned out to be AI generated. Most of the artwork for TS articles also appears to be AI generated. For video: I was watching a video on YT just today ("AI Interviews Americans at Walmart") that was AI generated (and definitely NSFW) - in all honesty, I couldn't tell it was AI generated. Ironically, there's a new TS article entitled "This AI country singer just became Billboard's number one" which goes further to prove my point.
Citing people using it doesn't mean AI understands it. Or is creating novel art, just lowest common denominator art.

Only last month AI made a big break through on the "previously impossible" Navier Stokes equations. Nature magazine did an article a few years back called "Mathematical discovery in the age of artificial intelligence" which you might find interesting.
You mean this one:



Where they say:

"Our use of PINNs [Physics Informed Neural Networks] goes beyond their typical role as general-purpose tools used for solving partial differential equations (PDEs)."

They didn't use generative AI. While every generative AI is a neural network, not every neural is a generative AI. What they did here was purpose train a PINN to look for unstable singularities under specific fluid conditions - that was the novel bit. Finding these singularities isn't new, using PINNs to solve specific physics problems isn't new (you have seen them used for PDEs, thermo, fluids, and structural problems for years before generative AI escaped university labs), and they still require a human to check, refine, and validate the work.

re: Navier Stokes

What is "impossible" about Navier-stokes is it a theory built on observation of physical phenomenon. We don't have a mathematics proof to turn that "theory" into "law". Singularities - stable or unstable - might help to discover this mathematics proof, but aren't in of themselves a proof.

I.e. this work has more to do with machine learning than generative AI. They used a completely different set of tools and expanded on their potential usages. The tool they built here may help a mathematician discover singularities to study, but it won't be writing Navier-stokes proofs anytime soon.

I'm sure there are lot's of minor effects that affect the speed (you left off air pressure and temperature) but all these are minimal compared to the slope. If the ball timing is that essential to a "waterfall" then perhaps he should use a microcontroller to time the release of balls.
Air pressure/friction and temperature are minor in this case. Ball-railing friction, ball-ball friction, and rail curves are not minor. And if a generative AI says you need a microcontroller to implement its design (now its vibe coding real-time software, on top of vibe physics) - when this real design does not use one - that tells you all you need to know about the AI design: over complicated at best, impossible at worst.
 
Back