Skip to content
Avatar

Sponsoring

@processing

Achievements

Achievements

Highlights

  • Pro
  • 3 discussions answered

Organizations

@garoa @arteprog
Block or Report

Block or report villares

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
villares/README.md

This animation is made with points in a Python collections.deque data structure, added by dragging the mouse (code shown bellow)

  • 🔭 I'm currently working on a PhD at Unicamp
  • 🌱 I should be talking less and concentrating
  • 👯 I’m looking to collaborate on open resources to teach programming in a visual context
  • 💬 Ask me about drawing with Python!
    • Check out py5, it brings in the Processing drawing infrastructure!
  • 📫 How to reach me: twitter.com/villares
    • If you think the things that I share are usefull, consider donating at ko-fi.com/villares
  • 😄 Pronouns: he/him
  • Fun fact: I actually use this repo to store some helper code I use in my drawings.
from collections import deque  # a double-ended queue
import py5  # check out https://github.com/py5coding 

history = deque(maxlen=512)  # mouse dragged positions

def setup():   # py5 will call this once to set things up
    py5.size(600, 400)
    py5.no_stroke()
    py5.color_mode(py5.HSB)

def draw():   # py5 will call this in a loop
    py5.background(51)
    for i, (x, y) in enumerate(history):
        py5.fill(i / 2, 255, 255, 128)
        py5.circle(x, y, 8 + i / 16)
    if history:
        history.append(history.popleft())

def mouse_dragged():  # py5 will call this when you drag the mouse
    history.append((py5.mouse_x, py5.mouse_y))
    
def key_pressed():   # py5 will call this when a key is pressed
    history.clear()

py5.run_sketch()

Pinned

  1. Resources for teaching programming for artists, designers and architects

    CSS 65 5

  2. Material do curso introdutório Programação Criativa de Monica Rizzolli e Alexandre Villares, em construção.

    45 15

  3. Studies in digital fabrication

    Python 8

  4. Material para ensino introdutório de programação com Python em um contexto visual

    Python 75 65

  5. One visual idea a day

    JavaScript 155 15

  6. Code snipets for working with arc tangents and bezier aproximations, mostly on Processing

    Python 10

2,009 contributions in the last year

Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Mon Wed Fri

Contribution activity

June 1, 2022

villares has no activity yet for this period.

Seeing something unexpected? Take a look at the GitHub profile guide.