Thursday, March 01, 2007


Floodfill passes acid test in Slice and Dice

I've been battling with the Slice and Dice code that I'd written to develop STL files into extruder trajectories for making things with Tommelise for the past two weeks. In theory, using a grid approach to developing slices is simpler than the method that Adrian has taken. In practice, however, when you try to map a perimeter onto a grid you will often encounter leaks between slightly less than perfectly linked line segments making up a perimeter. My code would get it right about 99.5% of the time. The problem was that you only had to get it wrong once in one layer to make a real mess of things.

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.

Nice :)
Yeah, it's finally coming together. :-)
nice. do you have a pic of the toolpath?
Ain't got a toolpath yet. Still working my way line by line through the code that generates the perimeter now. Got an even rarer exception that I found when I sliced the gearmotor coupling for the Mk 2 that puts the occasional perimeter line segment back to front.

This is taking far too long to get right. :-(
is there a reason that you're not using the reprap code that vik and adrian are using? i mean i understand wanting to try different mechanicals, board, etc, but theres no reason you should do EVERYTHING yourself.
Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]