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

4.2.09

training



Hi,
starting from three curves, the script creates a number of ellipses defined by the user.
The first curve is the place of the ellipses' center, and the other two defines the radiuses.
Finally there's a simple colour's modulation


Option Explicit

'Script written by Simone Righi
'trying to script something intresting

Call Main()
Sub Main()
Dim arrDom1,arrDom2,arrDom3
Dim strCrv1: strCrv1 = Rhino.GetObject("Select first curve please",4)
Dim strCrv2: strCrv2 = Rhino.GetObject("Select socond curve please",4)
Dim strCrv3: strCrv3 = Rhino.GetObject("Select third curve please",4)
Dim intNpt: intNpt = Rhino.GetInteger ("n. of points?",100,50,500)
Dim dblx,dbly,dblz
If IsNull (strCrv1) Then Exit Sub
If IsNull (strCrv2) Then Exit Sub
If IsNull (strCrv3) Then Exit Sub
arrDom1 = Rhino.CurveDomain(strCrv1)
arrDom2 = Rhino.CurveDomain (strCrv2)
arrDom3 = Rhino.CurveDomain (strCrv3)
Dim i,dblPar1,arrPt1,strPt1,arrLines
ReDim arrLines (intNpt)
For i=0 To intNpt
dblPar1 = arrDom1 (0)+ i*(arrDom1(1)-arrDom1(0))/intNpt

arrPt1 = Rhino.EvaluateCurve(strCrv1,dblPar1)
strPt1 = Rhino.AddPoint (arrPt1)
Call Rhino.ObjectColor(strPt1,RGB(i*255/intNpt, i*255/intNpt,0))
Dim dblPar2,arrPt2,strPt2
dblPar2 = arrDom2 (0)+ i*(arrDom2(1)-arrDom2(0))/intNpt

arrPt2 = Rhino.EvaluateCurve(strCrv2,dblPar2)
strPt2 = Rhino.AddPoint (arrPt2)
Call Rhino.ObjectColor(strPt2,RGB(i*255/intNpt, i*255/intNpt,0))
Dim dblPar3,arrPt3,strPt3
dblPar3 = arrDom3 (0)+ i*(arrDom3(1)-arrDom3(0))/intNpt

arrPt3 = Rhino.EvaluateCurve(strCrv3,dblPar3)
strPt3 = Rhino.AddPoint (arrPt3)
Call Rhino.ObjectColor(strPt3,RGB(i*255/intNpt, i*255/intNpt,0))
Dim strEll
'drawing ellipse from 3pts
strEll = Rhino.AddEllipse3Pt (arrPt1,arrPt2,arrPt3)
Call Rhino.ObjectColor(strEll,RGB(0,i*(255/intNpt),i*(255/intNpt)))
Next
End Sub


No comments:

Post a Comment