""" Lotka Volterra Attraktor (c) Juergen Meier (www.3d-meier.de) 24.12.2021 """ import c4d import math def CreateSplineObject(): # Variablen und Konstanten Name = "Lotka Volterra Attractor" a = 2.9851 # Konstante Lotka Volterra Attraktor b = 3 # Konstante Lotka Volterra Attraktor c = 2 # Konstante Lotka Volterra Attraktor x0 = 1.0 # Startwerte y0 = 1.0 # Startwerte z0 = 1.0 # Startwerte Delta = 0.01 # Delta Wert fuer die Berechnung N = 20000 # Anzahl Punkte Faktor = 1000 # Skalierungsfaktor x = x0 # Startwerte zuweisen y = y0 # Startwerte zuweisen z = z0 # Startwerte zuweisen obj = c4d.BaseObject(c4d.Ospline) # Splineobjekt erzeugen obj.ResizeObject(N) # Groesse des Spline festlegen obj[c4d.SPLINEOBJECT_CLOSED] = False #obj[c4d.SPLINEOBJECT_TYPE] = c4d.SPLINETYPE_LINEAR obj[c4d.SPLINEOBJECT_TYPE] = c4d.SPLINETYPE_BSPLINE #obj[c4d.SPLINEOBJECT_TYPE] = c4d.SPLINETYPE_BEZIER obj.SetName(Name) for i in range(0,N): dx=x-x*y+c*x*x-a*z*x*x dy=-y+x*y dz=-b*z+a*z*x*x x=x + Delta * dx y=y + Delta * dy z=z + Delta * dz obj.SetPoint(i, c4d.Vector(x*Faktor, y*Faktor, z*Faktor)) obj.Message(c4d.MSG_UPDATE) return obj def main(): slinobj = CreateSplineObject() doc.InsertObject(slinobj, None, None, True) c4d.EventAdd() if __name__=='__main__': main()