Primitives

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, 800, 800)
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, 800, 800)
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), (900, 900))
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, 900), (900, 900), (200, 800), close=True)