Marble & Turtlex
Turtlex Turtlex
Have you ever thought about how a simple recursive algorithm can create a pattern that feels like a brushstroke? I was playing with a little fractal generator the other day and it got me wondering if we could blend code and paint to make something that looks almost alive. What do you think?
Marble Marble
That sounds like a beautiful idea, the way code can echo the rhythm of a brushstroke. I've found that layering thin washes of paint over a subtle pixel pattern can bring a gentle pulse to a canvas. If you let the recursion dictate the strokes, it could feel like the painting is breathing. I'd love to see your experiment.
Turtlex Turtlex
That’s a neat thought—maybe we can make a tiny Python script that spits out a path for a brush, then hand‑paint those points. I’ll crank up the recursion depth and let the algorithm decide the strokes. The output will look like a digital sketch, and you can splash paint over it. I’ll send you the code in a moment, just be ready to get a little messy.
Marble Marble
That sounds like a lovely collaboration—I'll sit back with my palette ready and let the algorithm guide my hand. A little mess is part of the charm, I suppose. Send the code when you’re ready.
Turtlex Turtlex
import random import math # size of the canvas in pixels (just for reference) WIDTH, HEIGHT = 800, 800 # number of recursive layers LAYER_COUNT = 5 # base radius for the outermost stroke BASE_RADIUS = 300 # function that recursively generates points def generate_stroke(cx, cy, radius, depth): if depth == 0: return points = [] # how many points in this layer count = 8 * depth angle_step = 2 * math.pi / count for i in range(count): angle = i * angle_step + random.uniform(-0.1, 0.1) x = cx + radius * math.cos(angle) y = cy + radius * math.sin(angle) points.append((x, y)) # write the points to a simple text file (one per line) with open(f"stroke_depth_{depth}.txt", "a") as f: for p in points: f.write(f"{p[0]:.2f},{p[1]:.2f}\n") # recurse inward new_radius = radius * 0.7 generate_stroke(cx, cy, new_radius, depth - 1) # clear previous files for d in range(1, LAYER_COUNT + 1): try: open(f"stroke_depth_{d}.txt", "w").close() except: pass # start the recursion from the center generate_stroke(WIDTH / 2, HEIGHT / 2, BASE_RADIUS, LAYER_COUNT) print("Done! Each file contains a layer of points for your brush to follow.")
Marble Marble
That’s a lovely little script, the way it layers points like concentric rings. I’ll set up my easel and let the numbers guide my brush. It’ll be interesting to see how the randomness turns into soft, almost invisible strokes when I paint over them. Thank you for sharing this—excited to try it out.