Thursday, March 01, 2007
Floodfill passes acid test in Slice and Dice
How I solved the problem was to map the perimeter onto a bitmap and then floodfill it. After that, it is a simple matter to map the grid onto the bitmap and then check the color of each gridpoint. The hassle with that approach is that it entailed me getting acquainted with the not terribly well-documented differences between VB.NET 2003 in which I last did my last such programming and VB.NET 2005, which I am using now. The differences weren't trivial, let me tell you.
As an acid test I did a test slice on the 79 toothed gear that runs the z-axis on Vik's Zaphod.
It works like a champ! The floodfill routine that I found on the web isn't incredibly fast, but it gets the job done.
This is taking far too long to get right. :-(
Links to this post: