NCF参数化建筑论坛

标题: RVB ATTRACTOR SERIES 02: GUMOWSKI-MIRA [打印本页]

作者: njyqqq    时间: 2010-6-12 14:34
标题: 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.


作者: njyqqq    时间: 2010-6-12 14:35
Option Explicit
‘Script written by Elif Erdine

Call GumowskiMira()
Sub GumowskiMira()


Dim i


Dim x()


Dim y()


Dim pt()


Dim maxpoints


maxpoints = 5000



Dim
B


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

[size=0.9em]Posted:
April 16th, 2009 under
Parametric Design.
Comments:
1




.RVB ATTRACTOR SERIES 01: ROSSLER ATTRACTORRossler attractor behaves similarly to Lorenz attractor. It’s formed by 3 non-linear ordinary differential equations. (
http://en.wikipedia.org/wiki/Rossler_map
)



作者: njyqqq    时间: 2010-6-12 14:36
Call Rossler()
Sub Rossler()
           
Dim x, y, z

           
Dim maxpoints

           
maxpoints = 8000

           
Dim h

           
h = 0.025

           
Dim p(2)

           
Dim ptnew()

           
Dim i

           
Do While (i<maxpoints)

                       
p(0) = p(0) + h* dx(p(0), p(1), p(2))

                       
p(1) = p(1) + h* dy(p(0), p(1), p(2))

                       
p(2) = p(2) + h* dz(p(0), p(1), p(2))


                       
Rhino.AddPoint(p)

                       
ReDim Preserve ptnew(i)

                       
ptnew(i) = p

                       
i=i+1

           
Loop



           
Call Rhino.AddCurve(ptnew, 3)

End Sub


Function dx(ByVal x, ByVal y, ByVal z)
           
dx = -y-z

End Function
Function dy(ByVal x, ByVal y, ByVal z)
           
dy = x + 0.4*y

End Function
Function dz(ByVal x, ByVal y, ByVal z)
           
dz = 0.31 + z*(x-5.3)

End Function

[size=0.9em]Posted:
April 16th, 2009 under
Parametric Design.
Comments:
none




.RVB CURLICUE FRACTALI’ve recently started using Rhino Scripting as a design tool in my research. I will be documenting here my learning process through the .rvb scripts.
This study shows the Curlicue Fractal, which generates quite intricate patterns. (http://mathworld.wolfram.com/CurlicueFractal.html)



作者: njyqqq    时间: 2010-6-12 14:38
Call Curlicue()
Sub Curlicue()
            Dim f
            Dim i
            Dim j
            Dim pi
            pi = Rhino.Pi
            Dim sqtwo
            sqtwo = 1.4142135623730950488016887
            Dim eulers
            eulers = 0.577215664901532860606512
            Dim golden
            golden = 1.618033988749894848204586
            Dim lntwo
            lntwo = 0.69314718055994530941
            Dim e
            e= 2.71828182845904523536028747
            Dim p(2)
            Dim ptCur()
            
            For j=0 To 50000*pi Step sqtwo*pi*2
                       
                        f = f + j
                        p(0)= p(0) + Cos(f)
                        p(1)= p(1)+ Sin(f)
                        p(2)=p(2) + Cos(f)*Sin(f)
                       
                        ‘Rhino.AddPoint(p)
                        ReDim Preserve ptCur(i)
                        ptCur(i) = p
                        i=i+1
                       
            Next
            Call Rhino.addcurve(ptCur, 3)      

End Sub

Posted: April 16th, 2009 under Parametric Design.
Comments: none
作者: stratagem    时间: 2010-6-12 15:24
强大!!!!!!!!
作者: zdb888    时间: 2010-6-14 14:53
好    厉害的rvb.
作者: qq56    时间: 2010-6-14 23:57
来个打包的,xiexie
作者: crowwind    时间: 2010-6-17 16:45
厉害。。。。
作者: wawa    时间: 2011-4-28 17:19
very good!!!
作者: zdb888    时间: 2011-5-8 17:11
赞 , 厉害 !
作者: wojiaxue    时间: 2011-5-28 00:20
貌似好深奥啊
作者: mumu7    时间: 2011-7-1 16:24
学的好慢啊
作者: 花血殇    时间: 2011-7-15 09:01
赞一个 谢谢楼主




欢迎光临 NCF参数化建筑论坛 (http://bbs.ncf-china.com/) Powered by Discuz! X3.2