Pen plotter - devlog 4
I’ve been taking a break from cad, and instead working on converting images to toolpaths for the future plotter.
The first method I tried was using lines. For each pixel there is a block 10x10 steps wide, and if the image is very dark in that region, it’ll draw 10 lines in there, if it’s brighter it might only draw 5.
I also developed my own g-code like language called p-code, where there are only a few commands: MOVE X Y, PEN UP/DOWN, HOME, and SPEED (in steps per second). I turned the images into a series of p-code commands.
Since the pen plotter isn’t finished yet (and to be honest won’t be for a while), I made a simple interpreter and displayed the images using a matplotlib LineCollection.
In the future I’ll be exploring other methods of making images display, such as:
- Dots of variable spacing
- Sine waves of variable amplitude
- Zig Zag lines of variable density (but constant height)
- Converting SVG images into paths
- Finding outlines in images and drawing them, possibly using something like canny edge detection
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.