# van Rijn

Writes and draws stuff

I'm afraid I'm STILL on the Write LMR trip. It's not got tired yet.

I've decided to motorise a miniature Etch-A-Sketch.

I decided on steppers. Not servos. Servos hadn't enough rotation. Continuous servos had no positional feedback.

Here's my prototype circuit. Simple ULN2803 driver and a PIC 16F628. There's a max232 on there, too as the RS-232 interface to the PC.

WOW! It draws a circle. The most impressive bit of this is my implementation of Bresenham's line drawing algorithm. The circle is made up of straight lines. Straight lines are more difficult to draw than you might imagine...!

Look out for more swirly patterns coming soon. Maybe even an LMR logo!

What you see in the main photo there is a "Hilbert Curve." It's a space filling curve in that the algorithm causes the "pointer" to pass through all the cells in a given area.

Hey, how weird does the inside of an Etch-A-Sketch look? I HAD to do this. I programmed it to scan back and forth so all the grey dust got scraped off the glass. It took about an hour! Hmmm... Resolution is 750x500 = 375 KiloPixels (there's a new one) x 10ms per step = 3750 seconds = 62.5 minutes.

I presume all those little metal balley things (description specially for Frits) are where the magic grey coating comes from.

Below is my attempt at a Lissajous figure with two phases. I'm happy with that.

I got the machine to draw a picture of my eldest offspring. It's done by making "pixels" which consist of veritcal lines. The lines are closer together (more dense) for increasing levels of darkness. Later I will try to use a Hilbert curve to make up each pixel with an increasing "order" for increasing levels of darkness. The result should be much better, but it will be sloooooow.

This second photo is slightly easier to see the subject because it's so blurry!

For the sake of completeness, here's the front panel of the software I wrote on the PC to control it, including a preview of the image.

I'm off to see if I can get it to draw the contents of a DXF file. How hard could THAT be?

Can you believe it doesn't EVEN Write LMR yet? How remiss of me...

Update (7-Mar-2009): NOW, it writes LMR. BTW, reading a DXF file is more difficult than I thought.

## Comment viewing options

That could be easier than you think with a computer. Use a standard computer program to convert the image to black and white then use a simple trace program that treats the image like a maze, following one wall (for example left) all the way round.
The guy says he´s doing it by hand..  :)
It might actually be easier for a human: the computer has no feedback, so can't correct for the slop in the Etch-A-Sketch. Something I'd REALLY like to do is hook it up to a webcam, and write code so the PC can "see" the Etch-A-Sketch screen as it "draws."
There are trace programs that would convert to vectors but why bother? Use a rountine similar to what you cleared the screen with but every third line down is straight across. the pointer moves up and/or down to darken pixels as necessary for a bitmap image.
Yeah. One reason for doing the Hilber space-filling curve was that I had intended to use increasing orders for increasing darkness in pixels. I actually think that extra wiggles for extra darkness is what I'll do, though.

Isn't there aPhotoshop filter that converst raster images to line shading - it's called "pencil" or something similar.

Mike

You should have it connect to a computer so you can upload images to it and have it make them. :)

...or are you talking specifically of the upload of images?

Hmmm... I'd need some method of converting a raster image to a vector image.

I suppose I could do a simple edge finding routine, but how the heck would I convert that o vectors?

Hmmm...

Its an application that finds the lines in the image then converts it. That would be cool. :)

Here is some info on it: http://www.masternewmedia.org/how_to_convert_bitmaps_into_vectors/

You had my hopes up there. No it's still a manual task. I know one chap who's doing a PhD in the area and he says it can't be done. Here's an extract from the above web page:

Bitmap to vector conversion is a difficult, highly technical and time-consuming task. There is no program or utility which can vectorize the image you have into a perfect one because the software doesn't know what you need.

This is why bitmap to vector conversion work requires dedicated time, patience and several trial and error sessions to fine tune the best procedure and workflow to adopt for your assignment.

But I'm not going to let a little problem like that hold me down. I have a plan. A cunning plan.