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

18.2.09

phyllotaxis pavilion


The code realizes a pavilion along a selected curve. Pavilion internal radius is influenced by the distance between the curve and a
n attractor point. Holes-size is related to the distance between the curve and another attractor point (placed in this case near curve's midpoint). In this way holes become smaller moving towards curve's midpoint.

Option Explicit
'Script written by andrea bugli
' "shift" on http://andbug.blogspot.com
'Script version venerdì 20 febbraio 2009 19.54.31

Call fibonaccipavilion
Sub fibonaccipavilion

Dim strBpts

Dim arrcircle, strN
strN = 240
Dim strcurve: strcurve = rhino.GetObject("select a curve", 4, True, True)
Dim arrPoints: arrPoints = rhino.DivideCurve(strcurve, strN, False, True)

ReDim arrcircle(ubound(arrPoints))

'this point influences pavilion radius
Dim ptparam1: ptparam1 = rhino.GetObject("select curve attractor point")
Dim ptcoord1: ptcoord1 = rhino.PointCoordinates(ptparam1)

'this point influences holes size
Dim ptparam2: ptparam2 = rhino.GetObject("select holes attractor point")
Dim ptcoord2: ptcoord2 = rhino.PointCoordinates(ptparam2)

Dim i
Dim ptrot
Dim pt
Dim ptcurve
ReDim ptrot(ubound(arrPoints))
rhino.EnableRedraw(False)

For i = 0 To ubound(arrPoints)

Dim strPoncurve: strPoncurve = rhino.CurveClosestPoint(strcurve, arrPoints(i))
Dim strframe: strframe = rhino.Curveperpframe(strcurve, strPoncurve)
Dim tang: tang = rhino.curvetangent(strcurve, strPoncurve)
Dim dist: dist = rhino.Distance(arrPoints(i), ptcoord1)
Dim dist2: dist2 = rhino.Distance(arrPoints(i), ptcoord2)

'create the tube on which are placed my points
arrcircle(i) = rhino.addcircle(strframe, 60/dist)

ptcurve = rhino.CurveStartPoint(arrcircle(i))
pt = rhino.addpoint(ptcurve)

'points are rotated by a definited angle
ptrot(i) = rhino.RotateObject(pt, arrPoints(i), 137.52*i, tang, True)

rhino.Deleteobject(pt)

Next

Dim strFace1
Dim strHole1
Dim arrHoleSrf1
Dim arrSrfBrep1
Dim centerPt1
Dim dblDist1

Dim strFace2
Dim strHole2
Dim arrHoleSrf2
Dim arrSrfBrep2
Dim centerPt2
Dim dblDist2

Dim strLine
Dim strPlaneLine
Dim strBaseCrv

For i = 0 To ubound(ptrot)-13

'create triangular face between points
strFace1 = rhino.addSrfPt(array(rhino.PointCoordinates(ptrot(i)), rhino.PointCoordinates(ptrot(i+8)), rhino.PointCoordinates(ptrot(i+5)), rhino.PointCoordinates(ptrot(i))))

'create a curve on the triangular face
strHole1 = rhino.addcurve(array(rhino.PointCoordinates(ptrot(i)), rhino.PointCoordinates(ptrot(i+8)), rhino.PointCoordinates(ptrot(i+5)), rhino.PointCoordinates(ptrot(i))), 2)
centerPt1 = rhino.curveAreaCentroid(strHole1)
dblDist1 = rhino.Distance(ptcoord2, centerPt1(0))

'if distance between centerPt1 and second attractor point is bigger than a definited amount, scale curve by means of
'distance and make a hole in the triangular face. if distance is smaller, leave face intact
If Not (1-8/dblDist1<0.2) Then

strHole1 = rhino.ScaleObject(strHole1, centerPt1(0), array(1-8/dblDist1, 1-8/dblDist1, 1-8/dblDist1))
arrHoleSrf1 = rhino.addPlanarSrf(array(strHole1))
arrSrfBrep1 = Rhino.SplitBrep (strFace1, arrHoleSrf1(0), True)
Call rhino.DeleteObject(arrHoleSrf1(0))
Call rhino.DeleteObject(arrSrfBrep1(0))

End If

Call rhino.deleteObject(strHole1)

'------------------


'create triangular face between points
strFace2 = rhino.addSrfPt(array(rhino.PointCoordinates(ptrot(i+5)), rhino.PointCoordinates(ptrot(i+8)), rhino.PointCoordinates(ptrot(i+13)), rhino.PointCoordinates(ptrot(i+5))))

'create a curve on the triangular face
strHole2 = rhino.addcurve(array(rhino.PointCoordinates(ptrot(i+5)), rhino.PointCoordinates(ptrot(i+8)), rhino.PointCoordinates(ptrot(i+13)), rhino.PointCoordinates(ptrot(i+5))), 2)
centerPt2 = rhino.curveAreaCentroid(strHole2)
dblDist2 = rhino.Distance(ptCoord2, centerPt2(0))


'if distance between centerPt2 and second attractor point is bigger than a definited amount, scale curve by means of
'distance and make a hole in the triangular face. if distance is smaller, leave face intact
If Not (1-8/dblDist2<0.2) Then

strHole2 = rhino.ScaleObject(strHole2, centerPt2(0), array(1-8/dblDist2, 1-8/dblDist2, 1-8/dblDist2))
arrHoleSrf2 = rhino.addPlanarSrf(array(strHole2))
arrSrfBrep2 = Rhino.SplitBrep (strFace2, arrHoleSrf2(0), True)
Call rhino.DeleteObject(arrHoleSrf2(0))
Call rhino.DeleteObject(arrSrfBrep2(0))

End If

Call rhino.DeleteObject(strHole2)

Next

'create a tube on each side of the triangle
For i = 0 To ubound(ptrot)-13

strLine = rhino.addline(rhino.PointCoordinates(ptrot(i)), rhino.PointCoordinates(ptrot(i+8)))
strPlaneLine = rhino.PlaneFromNormal(rhino.PointCoordinates(ptrot(i)), rhino.VectorCreate(rhino.PointCoordinates(ptrot(i)), rhino.PointCoordinates(ptrot(i+8))))
strBaseCrv = rhino.addcircle(strPlaneLine, 0.05)
Call rhino.AddSweep1(strLine, strBaseCrv)

strLine = rhino.addline(rhino.PointCoordinates(ptrot(i)), rhino.PointCoordinates(ptrot(i+5)))
strPlaneLine = rhino.PlaneFromNormal(rhino.PointCoordinates(ptrot(i)), rhino.VectorCreate(rhino.PointCoordinates(ptrot(i)), rhino.PointCoordinates(ptrot(i+5))))
strBaseCrv = rhino.addcircle(strPlaneLine, 0.05)
Call rhino.AddSweep1(strLine, strBaseCrv)

strLine = rhino.addline(rhino.PointCoordinates(ptrot(i+5)), rhino.PointCoordinates(ptrot(i+8)))
strPlaneLine = rhino.PlaneFromNormal(rhino.PointCoordinates(ptrot(i+5)), rhino.VectorCreate(rhino.PointCoordinates(ptrot(i+5)), rhino.PointCoordinates(ptrot(i+8))))
strBaseCrv = rhino.addcircle(strPlaneLine, 0.05)
Call rhino.AddSweep1(strLine, strBaseCrv)

Next

call rhino.DeleteObjects(arrcircle)

Call rhino.DeleteObjects(ptrot)

rhino.enableredraw(True)

End Sub

4 comments:

  1. Nice post Andrea! We might discuss about developing some fabrication strategies for this pavilion...

    A couple of minor things to consider for the future:

    . relations between any organism and its environment are reciprocal, so buildings both affect and are affected by their environment (in short: beware of flat pavements! Haha...)

    . remember to place a comment from time to time into the scripts or they can get kinda puzzling...

    ReplyDelete
  2. Awesome! You makes us bite the dust.. But can you put just a few notes? they might be very useful!

    ReplyDelete
  3. I apologize if the script was a little bit unintelligible....now I put a few notes into it! I hope they might be useful!

    ReplyDelete