Ey, I’m really glad you share this, I’m having lots of fun with them.
I was trying to make a very sutil adjustment in the initial parameters and then apply it as a shape key, but I can’t get a fluid transition.
Am I missing something? or is just the nature of this attractors?
import bpy
import math
# Equations ///////////////////////////////// The Aizawa Attractor
# dx/dt = (z-β)*x-δ*y
# dy/dt = δ*x+(z-β)*y
# dz/dt = ɣ+α*z-(z**3/3)-(x**2+y**2)*(1+ε*z)+ζ*z*x**3
x0 = 0.1
y0 = 0
z0 = 0
i = 0
j = 0
w = 0
# Parametres
ε = 0.3
α = 0.95
ɣ = 0.6
δ = 3.5
β = 0.7
ζ = 0.1
Facteur = 10
Delta = 0.01
# Compteurs
t = 15000
Step = 25
# Listes
PointX = []
PointY = []
PointZ = []
VertexX = []
VertexY = []
VertexZ = []
def CalcPoints():
x=x0
y=y0
z=z0
for i in range (1,t):
dx = (z-β)*x-δ*y
dy = δ*x+(z-β)*y
dz = ɣ+α*z-(z**3/3)-(x**2+y**2)*(1+ε*z)+ζ*z*x**3
x= x + Delta * dx
y= y + Delta * dy
z= z + Delta * dz
PointX.append(x)
PointY.append(y)
PointZ.append(z)
subslistlen = int(len(PointX) / Step)
for i in range (subslistlen):
VertexX.append (PointX[ i * Step ])
VertexY.append (PointY[ i * Step ])
VertexZ.append (PointZ[ i * Step ])
def Aizawa():
CalcPoints()
bpy.ops.mesh.primitive_cube_add()
bpy.data.objects["Cube"].name = "Aizawa"
bpy.ops.object.editmode_toggle()
bpy.ops.transform.resize(value=(0, 0, 0))
bpy.ops.mesh.remove_doubles()
obj = bpy.data.objects['Aizawa']
mesh = obj.data
for j in range (len(VertexX)):
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":(0,0,0)})
bpy.ops.object.editmode_toggle()
for j in range (len(VertexX)):
vert = mesh.vertices[j]
vert.co[0] = VertexX[j]*Facteur
vert.co[1] = VertexY[j]*Facteur
vert.co[2] = VertexZ[j]*Facteur
bpy.ops.object.convert(target='CURVE')
bpy.ops.object.editmode_toggle()
bpy.ops.curve.spline_type_set(type='NURBS')
bpy.data.curves['Aizawa'].resolution_u = 3
bpy.ops.object.editmode_toggle()
def shKey():
bpy.ops.object.shape_key_add(from_mix=False)
bpy.ops.object.shape_key_add(from_mix=False)
CalcPoints()
for w in range (len(VertexX)) :
shKDATA=bpy.data.objects['Aizawa'].data.shape_keys.key_blocks['Key 1'].data[w]
shKDATA.co[0] = VertexX[w]*Facteur
shKDATA.co[1] = VertexY[w]*Facteur
shKDATA.co[2] = VertexZ[w]*Facteur
Aizawa()
x0 = 0.101
y0 = 0.001
z0 = 0.001
ε = 0.3
α = 0.95
ɣ = 0.6
δ = 3.5
β = 0.7
ζ = 0.1
Facteur = 10
Delta = 0.01
del PointX[:]
del PointY[:]
del PointZ[:]
del VertexX[:]
del VertexY[:]
del VertexZ[:]
shKey()