Close

XOR ZigZag

A project log for Gcode Playground

Writing my own Gcode generator for pen plotter

mike-szczysMike Szczys 05/02/2020 at 17:020 Comments

I wanted to try out the zigzag patterns from the last project log. I found a little bug in how a 0 density was treated, but otherwise, drawing this XOR pattern worked out well. Next stop is processing images.

def linesDemo(turtleObj, xlimit, ylimit, steps):
    for y in range(0, ylimit, steps):
        turtleObj.penup()
        turtleObj.setpos(0,y)
        turtleObj.pendown()
        for x in range(steps, xlimit, steps):
            density = (x ^ y) % 8
            zigzag(turtleObj, (x,y), steps/2, density)

I ran the program which generated the image above with the following settings:  linesDemo(stylus, 300, 300, 10)

Discussions