Author Archives: nuoxu

final script

Call Main()
Sub Main()
Dim arrPlane, i,k, strCrv(), strInnerCrv(), strSrf(), arrX, arrPt(), arrInnerPt(), counter, arrHorzSurf(), arrVertSurf(), counter1, counter2, counter3
Dim strCrvv, strInnerCrvv, j, UnrolledSlice, dblDist, arrTempPt, arrTempInnerPt, strHorzSurf, strVertSurf, arrCrvs()
Dim intRandom, loopcounter

counter1 = 0
For loopcounter = 0 To 12
i = Random(2,13)
arrX = sin(i/15*3.14)*12
ReDim Preserve strCrv(counter1)
ReDim Preserve strInnerCrv(counter1)
ReDim Preserve strSrf(counter1)
ReDim Preserve arrHorzSurf(counter1)
arrPlane = Rhino.PlaneFromPoints (array(0,0,i), array(1,0,i), array(0,1,i))
strCrv(counter1) = Rhino.AddCircle (arrPlane, arrX)
strInnerCrv(counter1) = Rhino.AddCircle (arrPlane, arrX-1)
If i = 13 Then
arrHorzSurf(counter1) = Rhino.AddPlanarSrf (array(strCrv(counter1)))
Else
arrHorzSurf(counter1) = Rhino.AddLoftSrf (array(strCrv(counter1),strInnerCrv(counter1)))
End If
counter1 = counter1 + 1
Next
Call Rhino.DeleteObjects (strCrv)
Call Rhino.DeleteObjects (strInnerCrv)

counter2 = 0
For loopcounter = 0 To 5
intRandom = Random(20,120)
For j = -180 To 179 Step intRandom
ReDim Preserve arrVertSurf(counter2)
counter = 0
For i = 1 To 14
arrX = sin(i/15*3.14)*12
ReDim Preserve arrPt(counter)
ReDim Preserve arrinnerPt(counter)
arrTempPt = Rhino.Polar (array(0,0,0), j, arrX)
arrPt(counter) = array(arrTempPt(0),arrTempPt(1),arrTempPt(2)+i)
arrTempInnerPt = Rhino.Polar (array(0,0,0), j, arrX-1)
arrinnerPt(counter) = array (arrTempInnerPt(0),arrTempInnerPt(1),arrTempInnerPt(2)+i)
counter = counter + 1
Next
strCrvv = Rhino.AddCurve (arrPt)
strinnerCrvv = Rhino.AddCurve (arrinnerPt)
arrVertSurf(counter2) = Rhino.AddLoftSrf (array(strCrvv, strInnerCrvv))
Call Rhino.DeleteObject (strCrvv)
Call Rhino.DeleteObject (strInnerCrvv)
Next
counter2 = counter2 + 1
Next

End Sub

Function Random(nMin, nMax)
Randomize
Random = Int((nMax-nMin+1)*Rnd+nMin)
End Function

Advertisements

final project _ initial script

Call Main()
Sub Main()
Dim arrPlane, i, strCrv(), strInnerCrv(), strSrf(), strLftCrv, arrX, arrPt(), arrInnerPt(), counter
Dim strCrvv, strInnerCrvv, strLftCrvv, j, dblDist, arrTempPt, arrTempInnerPt
For i = 2 To 13
arrX = sin(i/15*3.14)*12
ReDim Preserve strCrv(i-2)
ReDim Preserve strInnerCrv(i-2)
ReDim Preserve strSrf(i-2)
arrPlane = Rhino.PlaneFromPoints (array(0,0,i), array(1,0,i), array(0,1,i))
strCrv(i-2) = Rhino.AddCircle (arrPlane, arrX)
strInnerCrv(i-2) = Rhino.AddCircle (arrPlane, arrX-1)
If i = 13 Then
Call Rhino.AddPlanarSrf (array(strCrv(i-2)))
Else
Call Rhino.AddLoftSrf (array(strCrv(i-2),strInnerCrv(i-2)))
End If
Next

Call Rhino.DeleteObjects (strCrv)
Call Rhino.DeleteObjects (strInnerCrv)
For j = -180 To 179 Step 30
counter = 0
For i = 1 To 14
arrX = sin(i/15*3.14)*12
ReDim Preserve arrPt(counter)
ReDim Preserve arrinnerPt(counter)
arrTempPt = Rhino.Polar (array(0,0,0), j, arrX)
arrPt(counter) = array(arrTempPt(0),arrTempPt(1),arrTempPt(2)+i)
arrTempInnerPt = Rhino.Polar (array(0,0,0), j, arrX-1)
arrinnerPt(counter) = array (arrTempInnerPt(0),arrTempInnerPt(1),arrTempInnerPt(2)+i)
counter = counter + 1
Next
strCrvv = Rhino.AddCurve (arrPt)
strinnerCrvv = Rhino.AddCurve (arrinnerPt)
strLftCrvv = Rhino.AddLoftSrf (array(strCrvv, strInnerCrvv))
Next
End Sub

final project _ initial idea

I would like to make a mesh fabric light with cardboard. This mesh surface will be a layer of light filter to create random projections on the wall.

referecing image
scrap lights from graypants

cambodian vase

Call Main()
Sub Main()
Dim arrPlane, i, j, strCrv(), strInnerCrv(), strSrf1, strSrf2, arrLftSrf1, arrLftSrf2, arrLftSrf3
For j = 0 To 5
For i = 0 To 15
ReDim Preserve strCrv(i)
ReDim Preserve strInnerCrv(i)
arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*5), array(1,j*25,i*5), array(0,j*25+1,i*5))
If cos(i) < sin(j) Then
strCrv(i) = Rhino.AddCircle (arrPlane, 9.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 8.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, 4.0)
strInnerCrv(i) = Rhino.AddCircle (arrPlane, 3.0)
End If
If i = 0 Then
strSrf1 = Rhino.AddPlanarSrf (strCrv)
strSrf2 = Rhino.AddPlanarSrf (strInnerCrv)
End If
If i = 15 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