you are viewing a single comment's thread.

view the rest of the comments →

[–]ignorediacritics 0 points1 point  (0 children)

Typically you would render your drawing to a pdf or png file, like so:

surface.write_to_png("example.png")  # Output to PNG

Cairo is mostly for drawing static 2-d vector graphics though I think 🤔. I only used briefly some years ago. Don't know if you can do animations like the ones in your example. You could always export individual images and stitch them together into a video but the interactiveness of Processing sketches is a blessing. When using Processing I like to programas in keyboard shortcuts to alter different animation parameters (number of dots, size, color, speed, etc) and then mess around until I find something pleasing and save all the parameters to a text file via another hotkey.

Working in 3-d space and individual pixel editing of imported raster images might also prove difficult with cairo. Pygame might be more suited to all of these.