TL;DR: Can anyone point me to a good adaptive path fill algorithm?
Hey there, my name is James, and my daughter built an awesome painting robot with her friends over at Evil Mad Scientist labs, even brought it to the white house, very fun stuff!
Anyways, I'm a web programmer by day, and though it might be fun to try and write some software to get the robot to do some cool stuff, and for some crazy reason I decided to do this using standard web technologies like SVG and JavaScript, and.. it actually works! [see the project at github.com/techninja/robopaint]
But there's a problem: to fill in colors for given shapes, it requires some kind of path filling algorithm using a given size shape to cover every part of the shape internally, not to mention it has to take into account overlapping paths and occlusions.
I have successfully created "fake" fills, by following known paths like spirals and back and forth hatch lines over paths, while detecting occlusion using browser internal functions for detecting what object lies at a given x/y coordinate, but these fill functions fall incredibly short of doing anything other than simply following paths, and can be incredibly inefficient at filling certain paths (like filling borders, letters, or U shaped areas).
The question: I need an adaptive path filling algorithm. I know they're currently being used in similar CNC setups for milling, and similar algorithms are used by the Roomba and 3D printers to figure out coverage in the most efficient way possible. The issue comes in that I don't think any have ever been done in JavaScript, using native SVG paths.
Anyone out there know where I should look? I'm not too afraid to attempt to port something over to JS, or possibly even use it as is for a native Node.JS module. All my work will be sure to go back to the community and become open source as well.
Thanks for the help!