RVB Attractor Series 02: Gumowski-Mira – Rhino Scripting

. RVB Attractor Series 02: Gumowski-Mira

Gumowski-Mira attractors were developed at the CERN research centre in 1980 by I. Gumowski and C. Mira while aiming to calculate the trajectories of sub-atomic particles. They create organic patterns resembling natural/marine forms.

gm01_thumb

gm02_thumb

Option Explicit

‘Script written by Elif Erdine

Call GumowskiMira()

Sub GumowskiMira()

Dim i

Dim x()

Dim y()

Dim pt()

Dim maxpoints

maxpoints = 5000

DimB

B = 1

ReDim Preserve x(maxpoints)

ReDim Preserve y(maxpoints)

x(i) = 0

y(i) = 5

i=0

Do While (i < maxpoints)

x(i+1) = B*y(i) + GM(x(i))

y(i+1) = GM(x(i+1)) – x(i)

ReDim Preserve pt(i)

pt(i) = Array(x(i), y(i), 0)

If IsArray(pt(i)) Then

Call Rhino.AddPoint(pt(i))

Dim plane

plane = Rhino.PlaneFromNormal(pt(i), Array(0,0,1))

Call Rhino.AddCircle(plane, 0.2)

End If

i = i+1

Loop

If IsArray(pt) Then

Dim ptcloud

ptcloud = Rhino.AddPointCloud(pt)

End If

Dim ptdel

ptdel =Rhino.GetObjects(”select points to delete”, 1, , , True)

Call Rhino.DeleteObjects(ptdel)

End Sub

Function GM (ByVal x)

Dim A

A= 0.305

GM = A*x + 2*(1-A)*x^2 / (1+x^2)

End Function

source: Elif Erdine