Hi all,
I am new to Processing and to python for that matter. I am interested in creating linear, geometric ‘art’, in the first instance without animation, static.
I have managed to create a set of circles shifting increasingly to the right and with each time with decreasing diameter. See attachment.
And this is my code:
add_library('svg')
canvasX = 600
canvasY = 600
margin = 50
def setup():
size(canvasX, canvasY)
background(255)
global svg_output
svg_output = createGraphics(canvasX, canvasY, SVG, "circles_1_b.svg")
centerX = canvasX/2
centerY = canvasY/2
step = 10
def draw():
beginRecord(svg_output)
noLoop()
noFill()
global centerX
global centerY
global canvasX
global canvasY
global step
global margin
for i in range(canvasX - margin, (canvasX - margin)/2, - 2*step):
circle(centerX, centerY, i)
centerX = centerX + step
for i in range((canvasX - margin)/2, step, - 2*step):
circle(centerX, centerY, i)
centerX = centerX - step
endRecord()
save("circles_1_b.png")
Now I would like to get Processing to repeat the same drawing superimposed on the previous so that the circles shift downwards, then to the left, then upwards.
I know I can do that by repeating the above loops with small changes, but I think there must be a better way.
I am looking into the Python Processing reference, and I think first I need to group the circles in one shape with createShape. Then I’m trying various things with rotate() and translate() but I do not understand from the reference how these function work with the draw function.
Any tips, hints or words of wisdom are welcome!
Many thanks,
Leo