Author Archives: katieshima

broken window (katie)

2008_12_12_1_title2008_12_12_2_script-22008_12_12_3_open_closed-22008_12_12_4_overlay-22008_12_121Option Explicit
‘Script written by <insert name>
‘Script copyrighted by <insert company name>
‘Script version Sunday, December 07, 2008 4:41:24 PM

Call Main()
Sub Main()
Dim i,j,k,l,m, arrPt, strPoint, strTestPath, arrPoint, arrCCX, strCurve, counter, arrIntPoint(), strIntPoint, strCrv, strCrv2, strSrf
Dim arrIntPt, TestDistance, OrigDistance, ClosestPoint, strPath, arrDivPts, arrPoint1, arrPoint2, strIntLine(), closestLine
Dim arrPoints : arrPoints = Rhino.Getobjects (“select Points”, 1)
Dim arrCurves : arrCurves = Rhino.Getobjects (“select Curves”, 4)
Dim arrLine1(1), arrLine2(1), arrAngle, arrStepAngle, arrSltLCtrPt, arrSltLCtrFPt, arrSltLCtrBPt, strSltLCrvI1, strSltLCrvI2, arrSltLOutPt, arrSltLOutFPt, arrSltLOutBPt, strSltLCrvO1, strSltLCrvO2, strSltLCrvF, strSltLCrvB, StrSltL
Dim arrSltRCtrPt, arrSltRCtrFPt, arrSltRCtrBPt, strSltRCrvI1, strSltRCrvI2, arrSltROutPt, arrSltROutFPt, arrSltROutBPt, strSltRCrvO1, strSltRCrvO2, strSltRCrvF, strSltRCrvB, strPath2
Dim slotlength : slotlength = .5
Dim slotwidth: slotwidth = .1695
Dim slotoffset: slotoffset = .268
Dim matwidth: matwidth= .114
Call Rhino.UnselectAllObjects
Call Rhino.EnableRedraw (False)
For Each strPoint In arrPoints
arrPoint = Rhino.PointCoordinates (strPoint)
For i = 11.25 To 168.75 Step 45
arrPt = Rhino.Polar (arrPoint, i, 40, Rhino.WorldYZPlane)
strTestPath = Rhino.AddLine (arrPoint, arrPt)
counter = 0
For Each strCurve In arrCurves
arrCCX = Rhino.CurveCurveIntersection (strCurve, strTestPath)
If Not IsArray(arrCCX) Then
Rhino.Print “Selected curves do not intersect.”
Else
ReDim Preserve strIntLine(counter)
ReDim Preserve arrIntPoint(counter)
arrIntPoint(counter) = Rhino.AddPoint (arrCCX(j,1))
strIntLine(counter) = strCurve
counter = counter + 1
End If
Next
OrigDistance = 1000000
For m = 0 To UBound(arrIntPoint)
arrIntPt = Rhino.Pointcoordinates (arrIntPoint(m))
TestDistance = Rhino.Distance (arrPoint, arrIntPt)
If TestDistance < OrigDistance Then
OrigDistance = TestDistance
ClosestPoint = arrIntPt
ClosestLine = strIntLine(m)
End If
Call Rhino.DeleteObject (arrIntPoint(m))
Call Rhino.SelectObject (ClosestLine)
Call Rhino.UnselectAllObjects
Next
strPath = Rhino.AddLine (arrPoint, ClosestPoint)
Call Rhino.DeleteObject (strTestPath)
arrDivPts = Rhino.DivideCurveLength (strPath, 1)
‘Call Rhino.DeleteObject (strPath)
If i Mod 45 = 0 Then
l = 0
Else
l=1
End If
arrLine1(0) = Rhino.CurveStartPoint (strPath)
arrLine1(1) = Rhino.CurveEndPoint (strPath)
arrLine2(0) = Array(0,1,0)
arrLine2(1) = Array(0,0,0)
arrAngle = Rhino.Angle2(arrLine1, arrLine2)
If IsArray(arrAngle ) Then
Rhino.Print “Angle: ” & CStr(arrAngle(0))
End If
For k = l To UBound(arrDivPts) Step 2
‘Call Rhino.AddPoint (arrDivPts(k))
arrPoint1 = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
arrPoint2 = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
strCrv = Rhino.AddLine (arrPoint1, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strCrv2 = Rhino.AddLine (arrPoint2, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strSrf = Rhino.AddLoftSrf (Array(strCrv, strCrv2))
Call Rhino.DeleteObject(strCrv)
Call Rhino.DeleteObject(strCrv2)
‘Call Rhino.DeleteObject(strPath)
arrSltLCtrPt = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltLCtrFPt = Rhino.Polar (arrSltLCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI1 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrFPt)
arrSltLCtrBPt = Rhino.Polar (arrSltLCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI2 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrBPt)
arrSltLOutPt = Rhino.Polar (arrSltLCtrPt, i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltLOutFPt = Rhino.Polar (arrSltLOutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO1 = Rhino.AddLine(arrSltLOutPt, arrSltLOutFPt)
arrSltLOutBPt = Rhino.Polar (arrSltLOutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO2 = Rhino.AddLine(arrSltLOutPt, arrSltLOutBPt)
strSltLCrvF = Rhino.AddLine(arrSltLCtrFPt, arrSltLOutFPt)
strSltLCrvB = Rhino.AddLine (arrSltLCtrBPt, arrSltLOutBPt)
arrSltRCtrPt = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltRCtrFPt = Rhino.Polar (arrSltRCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI1 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrFPt)
arrSltRCtrBPt = Rhino.Polar (arrSltRCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI2 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrBPt)
arrSltROutPt = Rhino.Polar (arrSltRCtrPt, i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltROutFPt = Rhino.Polar (arrSltROutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO1 = Rhino.AddLine(arrSltROutPt, arrSltROutFPt)
arrSltROutBPt = Rhino.Polar (arrSltROutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO2 = Rhino.AddLine(arrSltROutPt, arrSltROutBPt)
strSltRCrvF = Rhino.AddLine(arrSltRCtrFPt, arrSltROutFPt)
strSltRCrvB = Rhino.AddLine (arrSltRCtrBPt, arrSltROutBPt)
Next
Next
For i = 33.75 To 191.25 Step 45
arrPt = Rhino.Polar (arrPoint, i, 40, Rhino.WorldYZPlane)
strTestPath = Rhino.AddLine (arrPoint, arrPt)
counter = 0
For Each strCurve In arrCurves
arrCCX = Rhino.CurveCurveIntersection (strCurve, strTestPath)
If Not IsArray(arrCCX) Then
Rhino.Print “Selected curves do not intersect.”
Else
ReDim Preserve strIntLine(counter)
ReDim Preserve arrIntPoint(counter)
arrIntPoint(counter) = Rhino.AddPoint (arrCCX(j,1))
strIntLine(counter) = strCurve
counter = counter + 1
End If
Next
OrigDistance = 1000000
For m = 0 To UBound(arrIntPoint)
arrIntPt = Rhino.Pointcoordinates (arrIntPoint(m))
TestDistance = Rhino.Distance (arrPoint, arrIntPt)
If TestDistance < OrigDistance Then
OrigDistance = TestDistance
ClosestPoint = arrIntPt
ClosestLine = strIntLine(m)
End If
Call Rhino.DeleteObject (arrIntPoint(m))
Call Rhino.SelectObject (ClosestLine)
Call Rhino.UnselectAllObjects
Next
strPath = Rhino.AddLine (arrPoint, ClosestPoint)
Call Rhino.DeleteObject (strTestPath)
arrDivPts = Rhino.DivideCurveLength (strPath, 1)
‘Call Rhino.DeleteObject (strPath)
If i Mod 45 = 0 Then
l = 0
Else
l=1
End If
arrLine1(0) = Rhino.CurveStartPoint (strPath)
arrLine1(1) = Rhino.CurveEndPoint (strPath)
arrLine2(0) = Array(0,1,0)
arrLine2(1) = Array(0,0,0)
arrAngle = Rhino.Angle2(arrLine1, arrLine2)
If IsArray(arrAngle ) Then
Rhino.Print “Angle: ” & CStr(arrAngle(0))
End If
For k = 2 To UBound(arrDivPts) Step 2
‘Call Rhino.AddPoint (arrDivPts(k))
arrPoint1 = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
arrPoint2 = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
strCrv = Rhino.AddLine (arrPoint1, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strCrv2 = Rhino.AddLine (arrPoint2, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strSrf = Rhino.AddLoftSrf (Array(strCrv, strCrv2))
Call Rhino.DeleteObject(strCrv)
Call Rhino.DeleteObject(strCrv2)
‘Call Rhino.DeleteObject(strPath)
arrSltLCtrPt = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltLCtrFPt = Rhino.Polar (arrSltLCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI1 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrFPt)
arrSltLCtrBPt = Rhino.Polar (arrSltLCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI2 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrBPt)
arrSltLOutPt = Rhino.Polar (arrSltLCtrPt, i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltLOutFPt = Rhino.Polar (arrSltLOutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO1 = Rhino.AddLine(arrSltLOutPt, arrSltLOutFPt)
arrSltLOutBPt = Rhino.Polar (arrSltLOutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO2 = Rhino.AddLine(arrSltLOutPt, arrSltLOutBPt)
strSltLCrvF = Rhino.AddLine(arrSltLCtrFPt, arrSltLOutFPt)
strSltLCrvB = Rhino.AddLine (arrSltLCtrBPt, arrSltLOutBPt)
arrSltRCtrPt = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltRCtrFPt = Rhino.Polar (arrSltRCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI1 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrFPt)
arrSltRCtrBPt = Rhino.Polar (arrSltRCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI2 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrBPt)
arrSltROutPt = Rhino.Polar (arrSltRCtrPt, i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltROutFPt = Rhino.Polar (arrSltROutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO1 = Rhino.AddLine(arrSltROutPt, arrSltROutFPt)
arrSltROutBPt = Rhino.Polar (arrSltROutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO2 = Rhino.AddLine(arrSltROutPt, arrSltROutBPt)
strSltRCrvF = Rhino.AddLine(arrSltRCtrFPt, arrSltROutFPt)
strSltRCrvB = Rhino.AddLine (arrSltRCtrBPt, arrSltROutBPt)
Next
Next
For i = 213.75 To 356.25 Step 45
arrPt = Rhino.Polar (arrPoint, i, 40, Rhino.WorldYZPlane)
strTestPath = Rhino.AddLine (arrPoint, arrPt)
counter = 0
For Each strCurve In arrCurves
arrCCX = Rhino.CurveCurveIntersection (strCurve, strTestPath)
If Not IsArray(arrCCX) Then
Rhino.Print “Selected curves do not intersect.”
Else
ReDim Preserve strIntLine(counter)
ReDim Preserve arrIntPoint(counter)
arrIntPoint(counter) = Rhino.AddPoint (arrCCX(j,1))
strIntLine(counter) = strCurve
counter = counter + 1
End If
Next
OrigDistance = 1000000
For m = 0 To UBound(arrIntPoint)
arrIntPt = Rhino.Pointcoordinates (arrIntPoint(m))
TestDistance = Rhino.Distance (arrPoint, arrIntPt)
If TestDistance < OrigDistance Then
OrigDistance = TestDistance
ClosestPoint = arrIntPt
ClosestLine = strIntLine(m)
End If
Call Rhino.DeleteObject (arrIntPoint(m))
Call Rhino.SelectObject (ClosestLine)
Call Rhino.UnselectAllObjects
Next
strPath = Rhino.AddLine (arrPoint, ClosestPoint)
Call Rhino.DeleteObject (strTestPath)
arrDivPts = Rhino.DivideCurveLength (strPath, 1)
‘Call Rhino.DeleteObject (strPath)
arrLine1(0) = Rhino.CurveStartPoint (strPath)
arrLine1(1) = Rhino.CurveEndPoint (strPath)
arrLine2(0) = Array(0,0,0)
arrLine2(1) = Array(0,1,0)
arrAngle = Rhino.Angle2(arrLine1, arrLine2)
If IsArray(arrAngle ) Then
Rhino.Print “Angle: ” & CStr(arrAngle(0))
End If
If i Mod 45 = 0 Then
l = 0
Else
l=1
End If
arrLine1(0) = Rhino.CurveStartPoint (strPath)
arrLine1(1) = Rhino.CurveEndPoint (strPath)
arrLine2(0) = Array(0,0,0)
arrLine2(1) = Array(0,1,0)
arrAngle = Rhino.Angle2(arrLine1, arrLine2)
If IsArray(arrAngle ) Then
Rhino.Print “Angle: ” & CStr(arrAngle(0))
End If
For k = 2 To UBound(arrDivPts) Step 2
‘Call Rhino.AddPoint (arrDivPts(k))
arrPoint1 = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
arrPoint2 = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
Call Rhino.AddLine (arrPoint1, arrPoint2)
strCrv = Rhino.AddLine (arrPoint1, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strCrv2 = Rhino.AddLine (arrPoint2, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strSrf = Rhino.AddLoftSrf (Array(strCrv, strCrv2))
Call Rhino.DeleteObject(strCrv)
Call Rhino.DeleteObject(strCrv2)
‘Call Rhino.DeleteObject(strPath)
arrSltLCtrPt = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltLCtrFPt = Rhino.Polar (arrSltLCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI1 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrFPt)
arrSltLCtrBPt = Rhino.Polar (arrSltLCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI2 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrBPt)
arrSltLOutPt = Rhino.Polar (arrSltLCtrPt, i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltLOutFPt = Rhino.Polar (arrSltLOutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO1 = Rhino.AddLine(arrSltLOutPt, arrSltLOutFPt)
arrSltLOutBPt = Rhino.Polar (arrSltLOutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO2 = Rhino.AddLine(arrSltLOutPt, arrSltLOutBPt)
strSltLCrvF = Rhino.AddLine(arrSltLCtrFPt, arrSltLOutFPt)
strSltLCrvB = Rhino.AddLine (arrSltLCtrBPt, arrSltLOutBPt)
arrSltRCtrPt = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltRCtrFPt = Rhino.Polar (arrSltRCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI1 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrFPt)
arrSltRCtrBPt = Rhino.Polar (arrSltRCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI2 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrBPt)
arrSltROutPt = Rhino.Polar (arrSltRCtrPt, i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltROutFPt = Rhino.Polar (arrSltROutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO1 = Rhino.AddLine(arrSltROutPt, arrSltROutFPt)
arrSltROutBPt = Rhino.Polar (arrSltROutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO2 = Rhino.AddLine(arrSltROutPt, arrSltROutBPt)
strSltRCrvF = Rhino.AddLine(arrSltRCtrFPt, arrSltROutFPt)
strSltRCrvB = Rhino.AddLine (arrSltRCtrBPt, arrSltROutBPt)
Next
Next
For i = 191.25 To 333.75 Step 45
arrPt = Rhino.Polar (arrPoint, i, 40, Rhino.WorldYZPlane)
strTestPath = Rhino.AddLine (arrPoint, arrPt)
counter = 0
For Each strCurve In arrCurves
arrCCX = Rhino.CurveCurveIntersection (strCurve, strTestPath)
If Not IsArray(arrCCX) Then
Rhino.Print “Selected curves do not intersect.”
Else
ReDim Preserve strIntLine(counter)
ReDim Preserve arrIntPoint(counter)
arrIntPoint(counter) = Rhino.AddPoint (arrCCX(j,1))
strIntLine(counter) = strCurve
counter = counter + 1
End If
Next
OrigDistance = 1000000
For m = 0 To UBound(arrIntPoint)
arrIntPt = Rhino.Pointcoordinates (arrIntPoint(m))
TestDistance = Rhino.Distance (arrPoint, arrIntPt)
If TestDistance < OrigDistance Then
OrigDistance = TestDistance
ClosestPoint = arrIntPt
ClosestLine = strIntLine(m)
End If
Call Rhino.DeleteObject (arrIntPoint(m))
Call Rhino.SelectObject (ClosestLine)
Call Rhino.UnselectAllObjects
Next
strPath = Rhino.AddLine (arrPoint, ClosestPoint)
Call Rhino.DeleteObject (strTestPath)
arrDivPts = Rhino.DivideCurveLength (strPath, 1)
‘Call Rhino.DeleteObject (strPath)
arrLine1(0) = Rhino.CurveStartPoint (strPath)
arrLine1(1) = Rhino.CurveEndPoint (strPath)
arrLine2(0) = Array(0,0,0)
arrLine2(1) = Array(0,1,0)
arrAngle = Rhino.Angle2(arrLine1, arrLine2)
If IsArray(arrAngle ) Then
Rhino.Print “Angle: ” & CStr(arrAngle(0))
End If
If i Mod 45 = 0 Then
l = 0
Else
l=1
End If
arrLine1(0) = Rhino.CurveStartPoint (strPath)
arrLine1(1) = Rhino.CurveEndPoint (strPath)
arrLine2(0) = Array(0,0,0)
arrLine2(1) = Array(0,1,0)
arrAngle = Rhino.Angle2(arrLine1, arrLine2)
If IsArray(arrAngle ) Then
Rhino.Print “Angle: ” & CStr(arrAngle(0))
End If
For k = 1 To UBound(arrDivPts) Step 2
‘Call Rhino.AddPoint (arrDivPts(k))
arrPoint1 = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
arrPoint2 = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), Sin(k/12)*4, Rhino.WorldYZPlane)
Call Rhino.AddLine (arrPoint1, arrPoint2)
strCrv = Rhino.AddLine (arrPoint1, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strCrv2 = Rhino.AddLine (arrPoint2, Array(arrDivPts(k)(0)-Sin(k/12)*5-1,arrDivPts(k)(1),arrDivPts(k)(2)))
strSrf = Rhino.AddLoftSrf (Array(strCrv, strCrv2))
Call Rhino.DeleteObject(strCrv)
Call Rhino.DeleteObject(strCrv2)
‘Call Rhino.DeleteObject(strPath)
arrSltLCtrPt = Rhino.Polar (arrDivPts(k), i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltLCtrFPt = Rhino.Polar (arrSltLCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI1 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrFPt)
arrSltLCtrBPt = Rhino.Polar (arrSltLCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvI2 = Rhino.AddLine(arrSltLCtrPt, arrSltLCtrBPt)
arrSltLOutPt = Rhino.Polar (arrSltLCtrPt, i+90+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltLOutFPt = Rhino.Polar (arrSltLOutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO1 = Rhino.AddLine(arrSltLOutPt, arrSltLOutFPt)
arrSltLOutBPt = Rhino.Polar (arrSltLOutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltLCrvO2 = Rhino.AddLine(arrSltLOutPt, arrSltLOutBPt)
strSltLCrvF = Rhino.AddLine(arrSltLCtrFPt, arrSltLOutFPt)
strSltLCrvB = Rhino.AddLine (arrSltLCtrBPt, arrSltLOutBPt)
arrSltRCtrPt = Rhino.Polar (arrDivPts(k), i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotoffset/2, Rhino.WorldYZPlane)
arrSltRCtrFPt = Rhino.Polar (arrSltRCtrPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI1 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrFPt)
arrSltRCtrBPt = Rhino.Polar (arrSltRCtrPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvI2 = Rhino.AddLine(arrSltRCtrPt, arrSltRCtrBPt)
arrSltROutPt = Rhino.Polar (arrSltRCtrPt, i+270+(arrAngle(0)-90)*k/UBound(arrDivPts), slotwidth, Rhino.WorldYZPlane)
arrSltROutFPt = Rhino.Polar (arrSltROutPt, i+180+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2-matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO1 = Rhino.AddLine(arrSltROutPt, arrSltROutFPt)
arrSltROutBPt = Rhino.Polar (arrSltROutPt, i+(arrAngle(0)-90)*k/UBound(arrDivPts), slotlength/2+matwidth/2, Rhino.WorldYZPlane)
strSltRCrvO2 = Rhino.AddLine(arrSltROutPt, arrSltROutBPt)
strSltRCrvF = Rhino.AddLine(arrSltRCtrFPt, arrSltROutFPt)
strSltRCrvB = Rhino.AddLine (arrSltRCtrBPt, arrSltROutBPt)
Next
Next

Next
Call Rhino.EnableRedraw (True)
End Sub

parametric window tactile louvers (katie)

2008_11_161Option Explicit
‘Script written by <insert name>
‘Script copyrighted by <insert company name>
‘Script version Monday, November 17, 2008 12:19:20 AM

Call Main()
Sub Main()
 Dim i, j, arrPt, arrPt2, strCrv, strPath, strSrf, strPoint, arrPoint
 Dim arrPoints : arrPoints = Rhino.Getobjects 
 Call Rhino.EnableRedraw (False)
 For Each strPoint In arrPoints
  arrPoint = Rhino.PointCoordinates (strPoint)
  For j = 1 To 10
   For i = -180 To 180 Step 45
    arrPt = Rhino.Polar (arrPoint, i, j,Rhino.WorldYZPlane)
    strCrv = Rhino.AddLine (arrPt, Array(arrPt(0)-j/2,arrPt(1),arrPt(2)))
    arrPt2 = Rhino.Polar (arrPoint, i+90, j/1.5,Rhino.WorldYZPlane)
    strPath = Rhino.AddLine (arrPoint,arrPt2)
    strSrf = Rhino.ExtrudeCurve (strCrv, strPath)
    Call Rhino.MoveObject (strSrf,Rhino.CurveMidPoint (strPath),Rhino.CurveStartPoint (strPath))
    Call Rhino.DeleteObject (strPath)
   Next
  Next
 Next
 Call Rhino.EnableRedraw (True)
End Sub

material test part 1

material test 1ap1000723

2008_11_102008_11_11

 

I’m interested in developing this into an operable louver system that can be changed from transparent to translucent. I would ideally like it to attach to a window. But if I were to use a light fixture I would use 150-watt bulbrite linear fluorescents.

pseudo-script:

make locators

make array of points

make array of lines from points

find relationships between lines and locators

make planar surfaces (louvers) according to relationships to locators

make array of points based on locations and sizes of louvers

make array of lines based on those points

make array of planar surfaces (connectors, to connect the louvers) from those lines

find the intersections between the louvers and the connectors

alter the shapes of the two to accommodate the fit

lay out the pieces for laser cutting

Katie Shima week 1 homework

Option Explicit

‘Script written by katie.shima

‘Script copyrighted by the shimamachine

‘Script version Monday, October 28, 2008 11:45:31 PM

Call Main()

Sub Main()

Dim arrPlane, i, j, strCrv(), strInnerCrv(), strSrf1, strSrf2, arrLftSrf1, arrLftSrf2, arrLftSrf3

Dim intWidth: intWidth = 8.0

Dim intMatWidth: intMatWidth = .375

Dim intTopWidth: intTopWidth = intWidth – 3

Dim intTopMatWidth: intTopMatWidth = .25

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 Or i=10 Then

strCrv(i) = Rhino.AddCircle(arrPlane,intWidth)

strInnerCrv(i) = Rhino.AddCircle (arrPlane, intWidth-intMatWidth)

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, intWidth-intTopWidth)

strInnerCrv(i) = Rhino.AddCircle(arrPlane, intWidth-intTopWidth-intTopMatWidth)

End If

Call Rhino.MoveObject(strCrv(i), array(0,0,0), array(2*cos(i),2*sin(i),0))

Call Rhino.MoveObject(strInnerCrv(i), array(0,0,0), array(2*cos(i),2*sin(i),0))

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

week1_homework1

proposal:
For my final project I propose to make a medium-sized plexiglas overhead light shade that would explore varying conditions of opacity, translucency, directionality, and user control, specifically exploring the transmission of light through the edges of the sheet of plexi, with the ultimate goal of developing a technique that could turn into a larger, outdoor pavilion-like enclosure. It will be tested with a projection or light source from above, and the viewer will look up at it. I will be working alone.