Week 3

——————-Week 3 Homework——————–

1. Required: Continue your materal/technique test (next iteration for Week 4 class)

2. Required: Prepare your pseudo-code project script (post pseudo-code on blog by midnight on Tuesday, November 12)

3. Optional: Start preparing your individual project script (individual desk crits will be next week)

——————-Week 3 Class Session——————–

This session will introduce two concepts. The first concept is a more controlled system of generating waves for benches. The second concept is the use of multiple distance based attractors. You will then take the digital model and use two different modification methods so that it can be fabricated on a CNC mill.

———————Step 1—————————-

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

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

———————Step 2—————————-

Call Main()
Sub Main()
Dim i, j, arrPt
For j = 0 To 8
For i = 0 To 32
arrPt = Array(j,i,0)
Call Rhino.AddPoint (arrPt)
Next
Next
End Sub

———————Step 3—————————-

_GetObjects

_PointCoordinates

Call Main()
Sub Main()
Dim k, i, j, arrPt, strAttractor
Dim arrStrAttractors : arrStrAttractors = Rhino.GetObjects (“select points”,1)
ReDim arrAttractors(UBound(arrStrAttractors ))
k=0
For Each strAttractor In arrStrAttractors
arrAttractors(k) = Rhino.pointcoordinates (strAttractor)
k=k+1
Next
For j = 0 To 8
For i = 0 To 32
arrPt = Array(j,i,0)
Call Rhino.AddPoint (arrPt)
Next
Next
End Sub

———————Step 4—————————-

_Multiple distance based attractors

_Extracting closest locator

_If/Then Else

Call Main()
Sub Main()
Dim k, i, j, arrPt, arrAttractor, strAttractor, testDistance, dblDistance
Dim arrStrAttractors : arrStrAttractors = Rhino.GetObjects (“select points”,1)
ReDim arrAttractors(UBound(arrStrAttractors ))
Dim d : d = Rhino.GetInteger (“max distance of falloff?”, 2)
k=0
For Each strAttractor In arrStrAttractors
arrAttractors(k) = Rhino.pointcoordinates (strAttractor)
k=k+1
Next
For j = 0 To 8
For i = 0 To 32
dblDistance = 100
arrPt = Array(j,i,0)
For Each arrAttractor In arrAttractors
testDistance = Rhino.Distance (arrPt, arrAttractor)
If testDistance < dblDistance Then
dblDistance = testDistance
End If
Next
If dblDistance < d Then
arrPt = Array(j,i,1.5)
Else
arrPt = Array(j,i,0)
End If
Call Rhino.AddPoint (arrPt)
Next
Next
End Sub

———————Step 5—————————-

_AddCurve

Call Main()
Sub Main()
Dim k, i, j, arrPt, arrAttractor, strAttractor, testDistance, dblDistance, arrCrvPts()
Dim arrStrAttractors : arrStrAttractors = Rhino.GetObjects (“select points”,1)
ReDim arrAttractors(UBound(arrStrAttractors ))
Dim d : d = Rhino.GetInteger (“max distance of falloff?”, 2)
k=0
For Each strAttractor In arrStrAttractors
arrAttractors(k) = Rhino.pointcoordinates (strAttractor)
k=k+1
Next
For j = 0 To 8
For i = 0 To 32
ReDim Preserve arrCrvPts(i)
dblDistance = 100
arrPt = Array(j,i,0)
For Each arrAttractor In arrAttractors
testDistance = Rhino.Distance (arrPt, arrAttractor)
If testDistance < dblDistance Then
dblDistance = testDistance
End If
Next
If dblDistance < d Then
arrPt = Array(j,i,1.5)
Else
arrPt = Array(j,i,0)
End If
arrCrvPts(i) = arrPt
Next
Call Rhino.addCurve (arrcrvPts)
Next
End Sub

———————Step 6—————————-

_ExtrudeCurve

_OffsetSurface

Call Main()
Sub Main()
Dim k, i, j, arrPt, arrAttractor, strAttractor, testDistance, dblDistance, arrCrvPts(), strCrv, strSrf, strOffsetSrf
Dim arrSrfCrv, arrOffsetSrfCrv
Dim arrStrAttractors : arrStrAttractors = Rhino.GetObjects (“select points”,1)
Dim strPath : strPath = Rhino.addLine (Array(0,0,0),Array(-1,0,0))
ReDim arrAttractors(UBound(arrStrAttractors ))
Dim d : d = Rhino.GetInteger (“max distance of falloff?”, 2)
k=0
For Each strAttractor In arrStrAttractors
arrAttractors(k) = Rhino.pointcoordinates (strAttractor)
k=k+1
Next
For j = 1 To 8
For i = 0 To 32
ReDim Preserve arrCrvPts(i)
dblDistance = 100
arrPt = Array(j,i,0)
For Each arrAttractor In arrAttractors
testDistance = Rhino.Distance (arrPt, arrAttractor)
If testDistance < dblDistance Then
dblDistance = testDistance
End If
Next
If dblDistance < d Then
arrPt = Array(j,i,1.5)
Else
arrPt = Array(j,i,0)
End If
arrCrvPts(i) = arrPt
Next
strCrv = Rhino.addCurve (arrcrvPts)
strSrf = Rhino.extrudeCurve (strCrv, strPath)
Call Rhino.deleteObject (strCrv)
strOffsetSrf = Rhino.OffsetSurface (strSrf, 0.25)
Next
End Sub

———————Step 7—————————-

_AddLoftSurface

_Clean Up

Call Main()
Sub Main()
Dim k, i, j, l, arrPt, arrAttractor, strAttractor, testDistance, dblDistance, arrCrvPts(), strCrv, strSrf, strOffsetSrf
Dim arrSrfCrv, arrOffsetSrfCrv
Dim arrStrAttractors : arrStrAttractors = Rhino.GetObjects (“select points”,1)
Dim strPath : strPath = Rhino.addLine (Array(0,0,0),Array(-1,0,0))
ReDim arrAttractors(UBound(arrStrAttractors ))
Dim d : d = Rhino.GetInteger (“max distance of falloff?”, 2)
k=0
For Each strAttractor In arrStrAttractors
arrAttractors(k) = Rhino.pointcoordinates (strAttractor)
k=k+1
Next
For j = 1 To 8
For i = 0 To 32
ReDim Preserve arrCrvPts(i)
dblDistance = 100
arrPt = Array(j-0.5,i,0)
For Each arrAttractor In arrAttractors
testDistance = Rhino.Distance (arrPt, arrAttractor)
If testDistance < dblDistance Then
dblDistance = testDistance
End If
Next
If dblDistance < d Then
arrPt = Array(j,i,1.5)
Else
arrPt = Array(j,i,0)
End If
arrCrvPts(i) = arrPt
Next
strCrv = Rhino.addCurve (arrcrvPts)
strSrf = Rhino.extrudeCurve (strCrv, strPath)
Call Rhino.deleteObject (strCrv)
strOffsetSrf = Rhino.OffsetSurface (strSrf, 0.16666)
arrSrfCrv = Rhino.DuplicateEdgeCurves (strSrf)
arrOffsetSrfCrv = Rhino.DuplicateEdgeCurves (strOffsetSrf)
For l = 0 To UBound (arrSrfCrv)
Call Rhino.addLoftSrf (Array(arrSrfCrv(l),arrOffsetSrfCrv(l)))
Next
Call Rhino.deleteObjects (arrSrfCrv)
Call Rhino.deleteObjects (arrOffsetSrfCrv)
Next
End Sub

———————Step 8—————————-

_Join Surfaces

Call Main()
Sub Main()
Dim k, i, j, l, arrPt, arrAttractor, strAttractor, testDistance, dblDistance, arrCrvPts(), strCrv, strSrf, strOffsetSrf
Dim arrSrfCrv, arrOffsetSrfCrv
Dim arrStrAttractors : arrStrAttractors = Rhino.GetObjects (“select points”,1)
Dim strPath : strPath = Rhino.addLine (Array(0,0,0),Array(-1,0,0))
ReDim arrAttractors(UBound(arrStrAttractors ))
Dim d : d = Rhino.GetInteger (“max distance of falloff?”, 2)
k=0
For Each strAttractor In arrStrAttractors
arrAttractors(k) = Rhino.pointcoordinates (strAttractor)
k=k+1
Next
For j = 1 To 8
For i = 0 To 32
ReDim Preserve arrCrvPts(i)
dblDistance = 100
arrPt = Array(j-0.5,i,0)
For Each arrAttractor In arrAttractors
testDistance = Rhino.Distance (arrPt, arrAttractor)
If testDistance < dblDistance Then
dblDistance = testDistance
End If
Next
If dblDistance < d Then
arrPt = Array(j,i,1.5)
Else
arrPt = Array(j,i,0)
End If
arrCrvPts(i) = arrPt
Next
strCrv = Rhino.addCurve (arrcrvPts)
strSrf = Rhino.extrudeCurve (strCrv, strPath)
Call Rhino.deleteObject (strCrv)
strOffsetSrf = Rhino.OffsetSurface (strSrf, 0.16666)
arrSrfCrv = Rhino.DuplicateEdgeCurves (strSrf)
arrOffsetSrfCrv = Rhino.DuplicateEdgeCurves (strOffsetSrf)
ReDim arrLftSrfs(UBound(arrSrfCrv))
For l = 0 To UBound(arrSrfCrv)
arrLftSrfs(l) = Rhino.addLoftSrf (Array(arrSrfCrv(l),arrOffsetSrfCrv(l)))
Next
Call Rhino.JoinSurfaces (Array(arrLftSrfs(0)(0),arrLftSrfs(1)(0),arrLftSrfs(2)(0),arrLftSrfs(3)(0),strSrf,strOffsetSrf),True)
Call Rhino.deleteObjects (arrSrfCrv)
Call Rhino.deleteObjects (arrOffsetSrfCrv)
Next
End Sub

———————Modeling Steps—————————

_Create Partitions

_Create contour cuts

_Create 6 contours per piece


——————-Week 3 Pre-Tutorial Session——————–

This session will introduce you to the concept of wave systems. You will essentially be lofting curves that have been generated by sin waves. You will then take the digital model and modify it so that it can be fabricated on a CNC mill.

———————Step 1—————————-

Option Explicit

‘Script written by mark.bearak

‘Script copyrighted by dtls.Architecture

‘Script version Monday, November 03, 2008 7:58:33 PM

Call Main()

Sub Main()

Dim arrPt

arrPt = array(0,0,0)

Call Rhino.AddPoint (arrPt)

End Sub



———————Step 2—————————-

_Sin Function

Call Main()

Sub Main()

Dim arrPt, i

For i = 0 To 8

arrPt = array(0,i,sin(i))

Call Rhino.AddPoint (arrPt)

Next

End Sub


———————Step 3—————————-

_Enable Redraw

_Adding a counter

_Creating physical limits

Call Main()

Sub Main()

Dim arrPt(), strCrv(), arrZHeight, i, j, CounterLines

Call Rhino.EnableRedraw (False)

For j = -2 To 2

CounterLines = 0

For i = 0 To 8

ReDim Preserve arrPt(CounterLines)

arrZHeight = sin(i*j)

If arrZHeight < 0 Then arrZHeight = 0

Call Rhino.AddPoint (array(j,i,arrZHeight))

arrPt(CounterLines) = array(j,i,arrZHeight)

CounterLines = CounterLines+1

Next

Call Rhino.AddCurve (arrPt)

Next

Call Rhino.EnableRedraw (True)

End Sub


———————Step 4—————————-

_2nd counter

_addLoftSrf

Call Main()

Sub Main()

Dim arrPt(), strCrv(), arrZHeight, i, j, CounterLines, CounterSurface

Call Rhino.EnableRedraw (False)

CounterSurface = 0

For j = -2 To 2

CounterLines = 0

ReDim Preserve strCrv(CounterSurface)

For i = 0 To 8

ReDim Preserve arrPt(CounterLines)

arrZHeight = sin(i*j)

If arrZHeight < 0 Then arrZHeight = 0

arrPt(CounterLines) = array(j,i,arrZHeight)

CounterLines = CounterLines+1

Next

strCrv(CounterSurface) = Rhino.AddCurve (arrPt)

CounterSurface = CounterSurface + 1

Next

Call Rhino.AddLoftSrf (strCrv)

Call Rhino.EnableRedraw (True)

End Sub


———————Step 5—————————-

_Extrude Surface

Call Main()

Sub Main()

Dim arrPt(), strCrv(), arrZHeight, i, j, CounterLines, CounterSurface, strLoftSrf, arrLoftSrf

Call Rhino.EnableRedraw (False)

Dim strHeightCrv : strHeightCrv = rhino.addLine (array(0,0,0),array(0,0, -0.25))

CounterSurface = 0

For j = -2 To 2

CounterLines = 0

ReDim Preserve strCrv(CounterSurface)

For i = 0 To 8

ReDim Preserve arrPt(CounterLines)

arrZHeight = (sin(i*j))*2

If arrZHeight < 0 Then arrZHeight = 0

arrPt(CounterLines) = array(j,i,arrZHeight)

CounterLines = CounterLines+1

Next

strCrv(CounterSurface) = Rhino.AddCurve (arrPt)

CounterSurface = CounterSurface + 1

Next

arrLoftSrf = Rhino.AddLoftSrf (strCrv,,,1)

Call Rhino.deleteobjects (strCrv)

For Each strLoftSrf In arrLoftSrf

Call Rhino.ExtrudeSurface (strLoftSrf, strHeightCrv)

Call Rhino.DeleteObject (strLoftSrf)

Next

Call Rhino.DeleteObject (strHeightCrv)

Call Rhino.EnableRedraw (True)

End Sub

———————Modeling Steps—————————

_Detemine size of material for contour cuts (in this case 2″ MDF)

_Split surface into sections

_Cap Planar Holes

_Lay out sheets

_Make sure each sheet is centered and recessed below 0 height based on width and export it as an igs.

_Rotate 3D surface and export it as an igs


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