Primitives

drawBot.rect(x, y, w, h)

Draw a rectangle from position x, y with the given width and height.

# draw a rectangle
#    x    y    w    h
rect(100, 100, 200, 200)
drawBot.oval(x, y, w, h)

Draw an oval from position x, y with the given width and height.

# draw an oval
#    x    y    w    h
oval(100, 100, 200, 200)
drawBot.line((x1, y1), (x2, y2)))

Draws a line between two given points.

# set a stroke color
stroke(0)
# draw a line between two given points
line((100, 100), (200, 200))
drawBot.polygon((x1, y1), (x2, y2), ..., close=True)

Draws a polygon with n-amount of points. Optionally a close argument can be provided to open or close the path. As default a polygon is a closed path.

# draw a polygon with x-amount of points
polygon((100, 100), (100, 200), (200, 200), (120, 180), close=True)