A playground for University of Bologna Students and a 6-days seminar about digital tools.

Digital generative tools are a very important part of architectural education. Andrew Kudless during his conference at SimAE was telling about chinese traditional woodcraftsmen: they spend their first two years of apprentice in making their own tools. Today, we have a large pool of digital ready made tools, built to respond to more or less specific problems or tasks, while keeping a level of flexibility and personalization. The majority of these tools have hidden capabilities, which can only be accessed bypassing the conventional interface and getting close to the machine logic of programming or building parametric components which generate shapes. Thus, seriality, differentiation, complexity can be implemented in architectural projects through code, in order to exploit the power of algorithmic based complex systems which are the basis of biological systems.


But, before going through such complexity, we must start with simple tasks and simple rules. Before playing seriously we need practice. This is the playground where a bunch of students will start to practice, a pool where they will share their results and questions. Maybe the stuff here that will be posted will seem obvious or naive to the navigated code-monkey, but, as I mentioned before, we all start from the basics and this is intended as a place to start. However, any comment and contribution is appreciated.

Playground is open, let's play! _ Alessio

15.3.09

Rhizome - part II





Here's my second attempt to create a rhizomatic system. I changed the previus planes for a surface, a sort of skin that separate interior from exterior -apart from specific holes, depending to attractor points.


Option Explicit
'Script written by
'Script copyrighted by
'Script version domenica 15 marzo 2009 19.40.15
Call Main()
Sub Main()
Dim arrCrv: arrCrv=Rhino.GetObjects("select data curves", 4)
Dim strSrf, strSrf0: strSrf0 = Rhino.AddLoftSrf(ArrCrv)
Dim intUInt: intUInt = Rhino.GetInteger("number of U intervals?", 10, 5)
Dim intVInt: intVInt = Rhino.GetInteger("number of V intervals?", 10, 5)
Dim IntNPts: intNPts = Rhino.GetInteger("how many samples for the curves?", 100, 50, 200)
If isNull (intNpts) Then Exit Sub
strSrf=strSrf0(0)
Dim arrUdom, arrVdom, arrpanel
ArrUdom = Rhino.SurfaceDomain(strSrf, 0)
ArrVdom = Rhino.SurfaceDomain(strSrf, 1)
Call Rhino.Print("surface U domain: from " & arrUdom(0) & " to " & arrUdom(1))
Call Rhino.Print("surface V domain: from " & arrVdom(0) & " to " & arrVdom(1))
Dim i, j, arrPt, Upar, Vpar, strFrame, dblUdist, dblVdist
ReDim arrPt(intUint-1, intVint-1)
Call Rhino.EnableRedraw(False)
For i=0 To IntUInt-1
For j=0 To intVInt-1
Upar= arrUdom(0)+i*(arrUdom(1)-arrUdom(0))/(intUInt-1)
Vpar= arrVdom(0)+j*(arrVdom(1)-arrVdom(0))/(intVInt-1)
'evaluating surface at (upar, vpar), it gives a 3d point
arrPt(i,j)=Rhino.EvaluateSurface(strSrf, array(upar, vpar))
'place a point there; describing a surface with loads of points
Call Rhino.addpoint(arrPt(i, j))
Next
Next
Dim ArrPtCurves(), arrPtCurvesC(), ArrCurves1()
ReDim ArrCurves1(intUInt-1)
Dim p, n
For p=0 To IntUInt-1
n=0
ReDim ArrPtCurves(p,n)
For i=0 To IntUInt-1
For j=0 To intVInt-1
If i= (j+p) Then
ReDim Preserve ArrPtCurves (p,n)
ReDim Preserve ArrPtCurvesC (n)
ArrPtCurves (p,n) = ArrPt(i,j)
ArrPtCurvesC(n)= arrPtCurves(p,n)
n=n+1
End If
Next
Next
ArrCurves1(p) = Rhino.AddCurve(arrPtCurvesC)
If n>2 Then
Dim dblRadius, q, ArrCirc, ArrPts
Dim arrDom: arrDom = Rhino.CurveDomain(arrCurves1(p))
Dim dblparam, arrCrvData, dblStep, arrPlane
ReDim arrCirc(intNpts)
dblStep = (arrDom(1)-arrDom(0))/(intNPts+1)
For q=0 To intNPts
dblParam = arrDom(0) + q*dblStep
arrCrvData = Rhino.CurveCurvature (arrCurves1(p), dblParam)
arrPlane = Rhino.CurvePerpFrame(arrCurves1(p), dblParam)
If Not isNull (arrCrvData) Then
dblRadius= 5/arrCrvData(3)
Else
dblRadius = 1
End If
arrCirc(q) = Rhino.AddCircle(arrPlane, dblRadius)
Next
Call Rhino.AddLoftSrf(arrCirc)
End If
Next
Dim ArrCurves2()
ReDim ArrCurves2(intUInt-1)
For p=0 To IntUInt-1
n=0
ReDim ArrPtCurves(p,n)
For i=1 To IntUInt-1
For j=0 To intVInt-1
If (i+p)=j Then
ReDim Preserve ArrPtCurves(p,n)
ReDim Preserve ArrPtCurvesC (n)
ArrPtCurves (p,n) = ArrPt(i,j)
ArrPtCurvesC(n)= arrPtCurves(p,n)
n=n+1
End If
Next
Next
ArrCurves2(p) = Rhino.AddCurve(arrPtCurvesC)
If n>2 Then
arrDom = Rhino.CurveDomain(arrCurves2(p))
ReDim arrCirc(intNpts)
dblStep = (arrDom(1)-arrDom(0))/(intNPts+1)
For q=0 To intNPts
dblParam = arrDom(0) + q*dblStep
arrCrvData = Rhino.CurveCurvature (arrCurves2(p), dblParam)
arrPlane = Rhino.CurvePerpFrame(arrCurves2(p), dblParam)
If Not isNull (arrCrvData) Then
dblRadius= 5/arrCrvData(3)
Else
dblRadius = 1
End If
arrCirc(q) = Rhino.AddCircle(arrPlane, dblRadius)
Next
Call Rhino.AddLoftSrf(arrCirc)
End If
Next
Dim ArrCurves3()
ReDim ArrCurves3(2*(intUInt-1))
For p=0 To 2*(IntUInt-1)
n=0
ReDim ArrPtCurves(p,n)
For i=0 To IntUInt-1
For j=0 To intVInt-1
If i+j=p Then
ReDim Preserve ArrPtCurves (p,n)
ReDim Preserve ArrPtCurvesC (n)
ArrPtCurves (p,n) = ArrPt(i,j)
ArrPtCurvesC(n)= arrPtCurves(p,n)
n=n+1
End If
Next
Next
ArrCurves3(p) = Rhino.AddCurve(arrPtCurvesC)
If n>2 Then
arrDom = Rhino.CurveDomain(arrCurves3(p))
ReDim arrCirc(intNpts)
dblStep = (arrDom(1)-arrDom(0))/(intNPts+1)
For q=0 To intNPts
dblParam = arrDom(0) + q*dblStep
arrCrvData = Rhino.CurveCurvature (arrCurves3(p), dblParam)
arrPlane = Rhino.CurvePerpFrame(arrCurves3(p), dblParam)
If Not isNull (arrCrvData) Then
dblRadius= 5/arrCrvData(3)
Else
dblRadius = 1
End If
arrCirc(q) = Rhino.AddCircle(arrPlane, dblRadius)
Next
Call Rhino.AddLoftSrf(arrCirc)
End If
Next
'Call Rhino.HideObject(strsrf)
'Call Rhino.MoveObject(StrSrf, array(0,0,0), array(0,0,2))
Dim strCrvTax
'Call Rhino.EnableRedraw(true)
Dim Stratt: strAtt = Rhino.GetObject("select attractor point",1)
Dim arrPtAtt: arrPtAtt = Rhino.PointCoordinates(strAtt)
'imput theresold distance
Dim dblTdist: dblTdist=Rhino.Getreal("threshold distance?",30,10)
'scale objects if inside theresold:
Dim arrBB,arrCP,dbldist,dblscale'center point
Dim k
Dim ArrPlanSrf
ReDim ArrPlanSrf(k)
Dim ArrPanelSrf1, ArrSrfPts1, ArrPanelSrf2, ArrSrfPts2
Dim e: e=0
Dim StrCrv, ArrCrvTax
ReDim ArrCrvTax(0)
Dim ArrTrimSrf
For i=0 To IntUInt-2
For j=0 To intVInt-2
'ReDim Preserve ArrCrvTax(e)
ReDim Preserve ArrPlanSrf(k+1)
arrpanel= array(arrPt(i,j), arrPt(i+1, j), arrPt(i, j+1), arrPt(i, j))
strCrvTax= Rhino.addcurve(arrpanel, 2)
arrBB = Rhino.BoundingBox(StrCrvTax)
'world contruction plane, non specifichiamo nulla come secondo fattore
arrCP = array((arrBB(2)(0)+ arrBB(4)(0))/2,(arrBB(2)(1)+ arrBB(4)(1))/2,(arrBB(2)(2)+arrBB(4)(2))/2)
'media
'2.find distance centerpoint-attractor
dbldist = Rhino.Distance(arrPtAtt,arrCP)
'3.scale according to distance inside thresold
If dbldist < dblscale =" ((dblTdist-dbldist)/(1.02*dblTdist))" strcrvtax=" Rhino.ScaleObject(StrCrvTax,arrCP,array(dblscale,dblscale,dblscale))" strcrvtax =" Rhino.Command(" arrcrvtax =" Rhino.SelectedObjects" arrtrimsrf =" Rhino.SplitBrep(strSrf," strsrf =" Rhino.IntersectBreps(arrTrimSrf(0)" strsrf="ArrTrimSrf(0)" arrpanel=" array(arrPt(i+1,j)," strcrvtax=" Rhino.addcurve(arrpanel," arrbb =" Rhino.BoundingBox(StrCrvTax)" arrcp =" array((arrBB(2)(0)+" dbldist =" Rhino.Distance(arrPtAtt,arrCP)" dblscale =" ((dblTdist-dbldist)/(1*dblTdist))" strcrvtax=" Rhino.ScaleObject(StrCrvTax,arrCP,array(dblscale,dblscale,dblscale))" strcrvtax =" Rhino.Command(" arrcrvtax =" Rhino.SelectedObjects" strcrvtax =" Rhino.ExtrudeCurveStraight(ArrCrvTax(0)," arrtrimsrf =" Rhino.SplitBrep(strSrf," strsrf="ArrTrimSrf(0)">












No comments:

Post a Comment