I’ve just started learning python. For one of my first test scripts I’ve been playing with the Mandelbrot set.

I’m sure this has been done here somewhere but it’s all new to me so I thought I would share for feedback.

Maybe someone could make a cool image with the code.

import bpy

print ("-+"* 50)

ob = bpy.context.object

# first function with mandelbrot equation and operator to copy objects

def f(x,c,move,f_range):

for h in range(0,f_range):

x = x**2 + c

copy = ob.copy()

copy.location.x = x+x*30
copy.location.y = move
copy.rotation_euler.z = move*.1

copy.rotation_euler.y = x

*10*

bpy.context.scene.objects.link(copy)

#bpy.ops.mesh.primitive_plane_add(radius=.3, location=(x+x30, move, x+x*25))

bpy.context.scene.objects.link(copy)

#bpy.ops.mesh.primitive_plane_add(radius=.3, location=(x+x

```
#print (x)
```

def f2(f2_range,f2_variation):

moved = 0

y = -1.35 #initial value for equation

print

for i in range (0,f2_range):

```
moved = moved +1
f(y, y, moved,7)
y = y + -f2_variation
print("iterated",i)
#number of iterations, amount to increase initial value
```

f2 (700, .001)

#with current values, numbers larger than 700 stray outside the pattern.

#!!!you must have an active object selected!!!#