This is the first attempt to recreate the phenomenon of Thigmotropism. This system of growth is genereted by the physical conctact between a plant organ and a solid object. A directional response caused by a differential growht. I want to improve this model with a larger adherence to the real growth process, for example recreate the influence of the vegetal hormone auxine that causes this behaviour operating locally.
I link also a video releted to this process.
http://www.youtube.com/watch?v=dTljaIVseTc
Option Explicit
'Giacomo Damiani
'Script version domenica 8 marzo 2009 18.52.06
Call Main()
Sub Main()
Dim i, arrcirc, dblparam, dblradius,arrplane
'scelgo una curva intorno alla quale crescere
Dim strCurve: strCurve = Rhino.GetObject("select curve", 4)
If isNull (strCurve) Then Exit Sub
Dim IntNPts: intNPts = Rhino.GetInteger("how many samples?", 100, 50, 500) 'chiedo il dimensionamento
If isNull (intNpts) Then Exit Sub
Call Rhino.EnableRedraw(False)
Dim arrDom: arrDom = Rhino.CurveDomain(strCurve)
ReDim arrCirc(intNpts-1),arrpoints(intNpts-1)
Dim dblstep: dblStep = (arrDom(1)-arrDom(0))/intNPts
Dim arrpt,strpt,arrpt2,arrpte,strpt2, dblradius2, strcurve1,strsrf
ReDim arrpt2(intNpts-1)
ReDim arrpte(intNpts-1)
ReDim arrpt(intNpts-1)
For i=0 To intNPts-1
dblParam = arrDom(0) + i*dblStep
arrPlane = Rhino.CurvePerpFrame(strCurve, dblParam)
arrPlane = Rhino.CurvePerpFrame(strCurve, dblParam)
dblRadius = 0.5
arrCirc(i) = Rhino.AddCircle(arrPlane, dblRadius)
arrpt(i) = Rhino.EvaluateCurve(strcurve,dblparam)
strpt = Rhino.AddPoint(arrpt(i))
arrpte(i) = Rhino.EvaluateCurve(arrcirc(i),dblparam*50)
arrpt2(i) = Rhino.MoveObject(strpt,arrpt(i),arrpte(i))
'sposto i punti sul cerchio
Next
Call Rhino.Addloftsrf(arrcirc)
Call Rhino.ObjectColor(arrCirc,RGB(255,0,0))
strcurve1 = Rhino.AddInterpCurve(arrpte)
Dim dblparam2, arrplane2
ReDim arrcirc2(intNpts-1)
Dim arrDom2: arrDom2 = Rhino.CurveDomain(strCurve1)
ReDim arrCirc2(intNpts-1)
Dim dblstep2: dblStep2 = (arrDom2(1)-arrDom2(0))/intNPts
'un secondo ciclo per la seconda serie di cerchi nei punti spostati
For i=0 To intNpts-1
dblParam2 = arrDom2(0) + i*dblStep2
arrPlane2 = Rhino.CurvePerpFrame(strCurve1, dblParam2)
dblRadius2 = 2/(i+3)
arrCirc2(i) = Rhino.AddCircle(arrPlane2, dblRadius2)
Next
Call Rhino.AddLoftSrf(arrCirc2)
Call Rhino.ObjectColor(arrCirc2,RGB(0,0,255))
Call Rhino.EnableRedraw(True)
End Sub
No comments:
Post a Comment