Week 1

——————-Week 1 Assignment—————————-

1. Required: Log-in to the blog.

2. Required: Choose typology and material for your installation.

3. Required: Modify vase script and post results.

——————-Week 1 Class———————————

This will be our first exercise in the XS,S,M,L,XL series for Parametric Realizations. The protocol will generate a series vases that can be 3D printed. Please review the scripts before class and come armed with questions.  Class will meet Thursday, October 23rd in Avery 115 from 8-10 PM.

——————Opening—————
__Introduction of “Baby Step”
__Scaling
__Material Relationship
__Keeping it real
__This idea of the Cell

——————Step 1—————
__Plane

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane
arrPlane = Rhino.PlaneFromPoints (array(0,0,0), array(0,1,0), array(1,0,0))
Call Rhino.AddCircle (arrPlane, 5.0)
End Sub

——————Step 2—————
__Parametric Loops
__Multiplying of Variables
__Consciousness of spatial constraints

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i
For i = 0 To 10
arrPlane = Rhino.PlaneFromPoints (array(0,0,i*4), array(0,1,i*4), array(1,0,i*4))
Call Rhino.AddCircle (arrPlane, 10.0)
Next
End Sub

——————Step 3—————
__Redim Preserve

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, strCrv()
For i = 0 To 10
ReDim Preserve strCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,0,i*7), array(0,1,i*7), array(1,0,i*7))
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
Next
Call Rhino.AddLoftSrf (strCrv)
End Sub

——————Step 4—————
__If/Then statements

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, strCrv()
For i = 0 To 10
ReDim Preserve strCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,0,i*7), array(0,1,i*7), array(1,0,i*7))
If i < 8 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
End If
Next
Call Rhino.AddLoftSrf (strCrv)
End Sub

——————Step 5—————
__Multiple loops
__Multiple variables

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv()
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*7), array(1,j*25,i*7), array(0,j*25+1,i*7))
If i < 8 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
End If
Next
Call Rhino.AddLoftSrf (strCrv)
Next
End Sub

——————Step 6—————
__Multiple parametric loops
__Cleaning up unneeded geometry

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv()
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < 8 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
End If
Next
Call Rhino.AddLoftSrf (strCrv)
Call Rhino.deleteobjects (strCrv)
Next
End Sub

——————Step 7—————
__Parametric If/Then statements
__Relationship links
__Optional parameters [ ]

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv()
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
End If
Next
Call Rhino.AddLoftSrf (strCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Next
End Sub

——————Step 8—————
__Capping Holes
__Extracting strings from Arrays
__Material Process

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv(), strLoftSrf, arrLoftSrfs
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
End If
Next
arrLoftSrfs = Rhino.AddLoftSrf (strCrv,,,1)
For Each strLoftSrf In arrLoftSrfs
Call Rhino.CapPlanarHoles (strLoftSrf)
Next
Call Rhino.deleteobjects (strCrv)
Next
End Sub

——————Step 9—————
__Building off existing portions of the script

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv()
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 9.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 4.0)
End If
Next
Call Rhino.AddLoftSrf (strCrv,,,1)
Call Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Next
End Sub

——————Step 10—————
__Specific If/Then scenarios

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv()
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 9.0)
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 4.0)
End If
If i = 0 Then
Call Rhino.AddPlanarSrf (strCrv)
Call Rhino.AddPlanarSrf (strInnerCrv)
End If
If i = 10 Then
Call Rhino.AddLoftSrf (array(strCrv(i),strInnerCrv(i)))
End If
Next
Call Rhino.AddLoftSrf (strCrv,,,1)
Call Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Next
End Sub

——————Step 11—————
__Material tolerance corrections

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv()
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 9.0)
If i = 0 Then
call rhino.MoveObject (strInnerCrv(i),array(0,0,0),array(0,0,1))
End If
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 4.0)
End If
If i = 0 Then
Call Rhino.AddPlanarSrf (strCrv)
Call Rhino.AddPlanarSrf (strInnerCrv)
End If
If i = 10 Then
Call Rhino.AddLoftSrf (array(strCrv(i),strInnerCrv(i)))
End If
Next
Call Rhino.AddLoftSrf (strCrv,,,1)
Call Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Next
End Sub

——————Step 12—————
__Extracting strings from arrays
__Cleaning up unneeded geometry
__Testing your final product

Option Explicit
‘Script written by mark.bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv(), strSrf1, strSrf2, arrLftSrf1, arrLftSrf2, arrLftSrf3
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+1)), array(1,j*25,i*(j+1)), array(0,j*25+1,i*(j+1)))
If i < j+3 Then
strCrv(i) = Rhino.AddCircle (arrPlane, 10.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 9.0)
If i = 0 Then
Call rhino.MoveObject (strInnerCrv(i),array(0,0,0),array(0,0,1))
End If
Else
strCrv(i) = Rhino.AddCircle (arrPlane, 5.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 4.0)
End If
If i = 0 Then
strSrf1 = Rhino.AddPlanarSrf (strCrv)
strSrf2 = Rhino.AddPlanarSrf (strInnerCrv)
End If
If i = 10 Then
arrLftSrf1 = Rhino.AddLoftSrf (array(strCrv(i),strInnerCrv(i)))
End If
Next
arrLftSrf2 = Rhino.AddLoftSrf (strCrv,,,1)
arrLftSrf3 = Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.JoinSurfaces (array(arrLftSrf1(0),arrLftSrf2(0),arrLftSrf3(0),strsrf1(0),strsrf2(0)),True)
Call Rhino.deleteobjects (strCrv)
Call Rhino.DeleteObjects (strInnerCrv)
Next
End Sub

——————-Week 1 Pre-Tutorial Session——————–

This tutorial will be a crash course in Rhino.Script for those of you who have no previous experience. Please review the steps, if you can check off all of the topics then you can skip this weeks tutorial. See you on Wednesday at 6:00 in Fayerweather 202.

——————Opening—————

__Script Editor

__Help Menu

__VB MSDN Database

__Notepad

__Layout

__Start a Catalog

——————Step 1—————

__Option Explicit – Clears all previous variables

__ ‘ – Comment, Rhino ignores

__Call – a heads up to rhino that you are going to execute protocol, requires ()

__Sub/End Sub – Isolates protocol

__Array – a variable that contains multiple inputs (x,y,z) (1,53,363,6643,343)

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Call Rhino.AddPoint (array(0,0,0))
End Sub

——————Step 2—————

__Dim – Tells Rhino you are declaring a variable

__Isolating Variables – Separates variable from protocol

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt
arrPt = array(0,0,0)
Call Rhino.AddPoint (arrPt)
End Sub

——————Step 3—————

__Loop – Repeats a given protocol a specified amount (For/Next)

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt, i
For i = 0 To 10
arrPt = array(0,0,0)
Call Rhino.AddPoint (arrPt)
Next
End Sub

——————Step 4—————

__Parametric Looping – Changes variables based on the loop

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt, i
For i = 0 To 10
arrPt = array(i,0,0)
Call Rhino.AddPoint (arrPt)
Next
End Sub

——————Step 5—————

__Pausing for user input – allows user to manually input variable (get…)

__Creating Lines – Rhino.addLine (arrStart, arrEnd)

__String Returns – variable name that contains letters (strWord)

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt, i, arrStPt
arrStPt = rhino.getpoint (“select your starting point”)
Call Rhino.AddPoint (arrStPt)
For i = 0 To 10
arrPt = array(i,0,0)
Call Rhino.AddPoint (arrPt)
Call Rhino.addLine (arrStPt,arrPt)
Next
End Sub

——————Step 6—————

__Adding math function – sin(variable),cos(variable)

__Integers/Real – integer – whole number (8,5,3),  real – any number (5.5334)

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt, i, arrStPt, intLoop
intLoop = rhino.GetInteger (“how many times would you like your loop to run”,20,0)
arrStPt = rhino.getpoint (“select your starting point”)
Call Rhino.AddPoint (arrStPt)
For i = 0 To intLoop
arrPt = array(i,sin(i),cos(i))
Call Rhino.AddPoint (arrPt)
Call Rhino.addLine (arrStPt,arrPt)
Next
End Sub

——————Step 7—————

__Overriding the variable – extracting information from original
variable and then re appropriating it

__Breaking down arrays into distinct units – arrName(x)

__Clean up the script – throwing away needless info

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt, i, arrStPt, intLoop, arrNewStPt
intLoop = rhino.GetInteger (“how many times would you like your loop to run”,20,0)
arrStPt = rhino.getpoint (“select your starting point”)
For i = 0 To intLoop
arrNewStPt = array(arrStPt(0)+i,arrStPt(1),arrStPt(2))
arrPt = array(i,sin(i),cos(i))
Call Rhino.addLine (arrNewStPt,arrPt)
Next
End Sub

——————Step 8—————

__Redim – Tells rhino that you are about to declare a variable with
multiple inputs (array)

__Adding multiple inputs into a single variable– variable name (i)

__Creating a surface – Rhino.addloftsrf (arrCurves)

Option Explicit
‘Script written by Mark Bearak
‘Script copyrighted by dtls.Architecture
‘Script version Tuesday, October 21, 2008 8:07:04 PM

Call Main()
Sub Main()
Dim arrPt, i, arrStPt, intLoop, arrNewStPt
intLoop = rhino.GetInteger (“how many times would you like your loop to run”,20,0)
arrStPt = rhino.getpoint (“select your starting point”)
ReDim arrCrvs(intLoop)
For i = 0 To intLoop
arrNewStPt = array(arrStPt(0)+i,arrStPt(1),arrStPt(2))
arrPt = array(i,sin(i),cos(i))
arrCrvs(i) = Rhino.addLine (arrNewStPt,arrPt)
Next
Call Rhino.AddLoftSrf (arrCrvs)
End Sub

 

Advertisements

2 responses to “Week 1

  1. Pingback: Week 1 Pre-tutorial has been posted « parametric realizations fall 2008

  2. Pingback: Week 1 - XS Parametric Vases have been posted « parametric realizations fall 2008

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s