I’d love to add voronoi stippling to the Makelangelo robot software. It makes my head hurt trying to understand the math, so I need your supple young brain to grok it for me.
This is an example of voronoi stippling from StippleGen, the program used by Evil Mad Scientist Laboratories for their EggBot. I want to incorporate the same style into the Makelangelo and then tweak it in wierd ways.
The Makelangelo software is Java. I’d like to give you a BufferedImage, let it run for until the user hits ‘stop’, and get back a list of points x,y,z, where z is the circle radius or diameter (your choice). Then the code I’ve already got can turn it into gcode and send it to the robot, or change the circles to stars, or play connect-the-dots… the list goes on.
Tonight I hope to finish setting up a Makelangelo on the mirror at VHS for those of you that would like to give it a try. It’ll look like this, but use a washable marker on glass.
Why not use their code directly? It’s LGPL, and the backend is in
toxiclibs. I’ve played around with Voronoi diagrams and travelling salesman
problem (TSP) and finding good implementations can be a bitch. This one is
not amazing, but works well (some guy had a real-time video conversion
code, but the solutions were not as nice). The variable dot size is also
very nice, but doesn’t matter for TSP. There is also a library that you can
add to gimp or inkscape that does stippling (but not TSP).
I would be happy to give it a try, but it would probably not be a wise
investment of our time as I’d have to start from scratch with java. A bored
java coder should be able to repurpose stipplegen to your needs without too
much aggravation I would think. I would also use their TSP code while your
at it…
I’m not 100% their license is compatible with my purposes. If it’s not a good use of your time, that’s cool. Just putting it out there coz I haven’t made progress on it in … way too long… so maybe someone else wants to take a crack at it.
Does your code generate the dots from which it then does the TSP
calculation?
I’ve seen a few versions of evilmadscientist’s code throughout the years.
It’s based on the work of a phd student then at SFU, and for a while they
lost access to the source, it’s relatively recently that they came up with
stipplegen, after getting his code back. It definitely sounds non-trivial
(to me at least).
I haven’t had the misfortune of having to deal with licensing issues, but
it sounds like it will be a pain in the ass. I imagine you want to load
jpg/png images, probably increase contrast, turn to black and white, and
then do voronoi on that. Just checking a bit into libraries for the image
manipulation stuff, they seem to be at least LGPL (processing) or weird
stuff (imagemagick). I thought LGPL was pretty permissive, and could even
be made to work with app stores.
I’ve got the image loading from four different formats, constrast adjustment, channel separating and convert to greyscale. I could even generate a separate voronoi for each color channel.
What I don’t get is how to generate the voronoi diagram and how to adjust the centroids for the next iteration. Really if someone could ELI5 those two bits, I’d be able to do the rest.
When you think you’re ready to try it out, there’s a Makelangelo set up at VHS. I think there’s a loose wire on the right stepper, it’s losing a few steps and messing up drawings.