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

Advertisements

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