begum tirpanci + hande cigerli


Final Submissions
•2010/02/17 • Leave a CommentrandomMemberSelection [class 20100113]
•2010/01/13 • Leave a Commentscript below randomly selects members within a group of objects and puts them into another layer.
Option Explicit
'Script written by
'Script copyrighted by
'Script version Wednesday, January 13, 2010 10:58:41 AM
Call Main()
Sub Main()
Dim allMem
allMem = rhino.getobjects("select the objects")
Dim i
Dim flag
For i = 0 To UBound (allMem)
flag = Rnd()
If flag < 0.25 Then
Rhino.ObjectLayer allMem(i), "Layer 03"
End If
Next
End Sub
skyScraper | Stage01 | Concepts
•2009/12/29 • Leave a Commentsurface Offset+Connection
•2009/12/29 • Leave a Comment
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Tuesday, December 15, 2009 10:28:40 AM
Dim uNum
Dim vNum
Call Main()
Sub Main()
Dim mySrf
Dim mySrf1
uNum = Rhino.GetInteger ("enter u division number",10)
vNum = Rhino.GetInteger ("enter v division number",20)
mySrf = rhino.GetObject("select surface")
mySrf1 = rhino.OffsetSurface (mySrf,16)
rhino.EnableRedraw False
'get the surface points from the first function
Dim srfPt
Dim srfPt1
srfPt = uvPts(mySrf,uNum,vNum)
srfPt1 = uvPts(mySrf1,uNum,vNum)
'create xBrace on the uv grid
Dim xBr
Dim xBr1
xBr = xBrace(srfPt)
xBr1 = xBrace(srfPt1)
'create sub syrface
Dim sSrf
'sSrf = subSrf(srfPt)
Dim i,j
For i = 0 To uNum
For j = 0 To vNum
rhino.AddLine srfPt(i,j),srfPT1(i,j)
Next
Next
rhino.EnableReDraw True
End Sub
Function uvPts(srf, uDiv, vDiv)
'find the surface domain
Dim srfDomU
Dim srfDomV
srfDomU = Rhino.SurfaceDomain(srf,0)
srfDomV = Rhino.SurfaceDomain(srf,1)
'define parameter variables
Dim parU
Dim parV
Dim parUV
'all points array
Dim allPt
ReDim allPt (uDiv,vDiv)
'counters
Dim i,j
For i = 0 To uDiv
For j = 0 To vDiv
parU = (srfDomU(1)/uDiv)*i
parV = (srfDomV(1)/vDiv)*j
parUV = Array(parU,parV)
allPt(i,j) = Rhino.EvaluateSurface (srf, parUV)
rhino.AddPoint allPt(i,j)
Next
Next
uvPts = allPt
End Function
Function xBrace(ptArray)
rhino.AddLayer "xBrace"
Dim m
Dim n
Dim a1
Dim a2
For m = 0 To uNum-1
For n = 0 To vNum-1
a1 = rhino.AddLine (ptArray(m,n), ptArray(m+1,n+1))
a2 = rhino.AddLine (ptArray(m+1,n), ptArray(m,n+1))
rhino.ObjectLayer a1, "xBrace"
rhino.ObjectLayer a2, "xBrace"
Next
Next
End Function
surface Components-2 [class 20091215]
•2009/12/17 • Leave a Commentthis script includes functions that add X-braces and triangular surfaces as surface components
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Tuesday, December 15, 2009 10:28:40 AM
Dim uNum
Dim vNum
Call Main()
Sub Main()
Dim mySrf
uNum = Rhino.GetInteger ("enter u division number",10)
vNum = Rhino.GetInteger ("enter v division number",10)
mySrf = rhino.GetObject("select surface")
rhino.EnableRedraw False
'get the surface points from the first function
Dim srfPt
srfPt = uvPts(mySrf,uNum,vNum)
'create xBrace on the uv grid
Dim xBr
xBr = xBrace(srfPt)
'create sub syrface
Dim sSrf
sSrf = subSrf(srfPt)
rhino.EnableReDraw True
End Sub
Function uvPts(srf, uDiv, vDiv)
'find the surface domain
Dim srfDomU
Dim srfDomV
srfDomU = Rhino.SurfaceDomain(srf,0)
srfDomV = Rhino.SurfaceDomain(srf,1)
'define parameter variables
Dim parU
Dim parV
Dim parUV
'all points array
Dim allPt
ReDim allPt (uDiv,vDiv)
'counters
Dim i,j
For i = 0 To uDiv
For j = 0 To vDiv
parU = (srfDomU(1)/uDiv)*i
parV = (srfDomV(1)/vDiv)*j
parUV = Array(parU,parV)
allPt(i,j) = Rhino.EvaluateSurface (srf, parUV)
rhino.AddPoint allPt(i,j)
Next
Next
uvPts = allPt
End Function
Function xBrace(ptArray)
rhino.AddLayer "xBrace"
Dim m
Dim n
Dim a1
Dim a2
For m = 0 To uNum-1
For n = 0 To vNum-1
a1 = rhino.AddLine (ptArray(m,n), ptArray(m+1,n+1))
a2 = rhino.AddLine (ptArray(m+1,n), ptArray(m,n+1))
rhino.ObjectLayer a1, "xBrace"
rhino.ObjectLayer a2, "xBrace"
Next
Next
End Function
Function subSrf(ptArray)
rhino.AddLayer "subSrf",RGB(20,210,200)
rhino.AddLayer "subSrf_Off", RGB(100,10,200)
Dim m
Dim n
Dim allSubSrf
ReDim allSubSrf(uNum-1,vNum-1)
For m = 0 To uNum-1
For n = 0 To vNum-1
allSubSrf(m,n) = rhino.AddSrfPt (Array(ptArray(m,n), ptArray(m+1,n),ptArray(m+1,n+1)))
rhino.ObjectLayer allSubSrf(m,n),"subSrf"
rhino.OffsetSurface allSubSrf(m,n),-1.5
rhino.ObjectLayer rhino.firstObject,"subSrf_off" 'the last object created in the scene.
Next
Next
subSrf = allSubSrf
End Function
surface Components [class 20091208/11]
•2009/12/12 • Leave a Commentthis script is pretty much same with the one in the previous post.
the additional function “cell” adds a cellular component on the surface.
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Friday, December 11, 2009 11:25:09 AM
Call Main()
Sub Main()
rhino.AddLayer "border"
rhino.AddLayer "cell"
'get input surface
Dim srf
srf = Rhino.GetObject("select surface",8)
'get the division numbers for U and v directions
Dim uRes
Dim vRes
uRes = rhino.GetInteger ("enter u division number",10)
vRes = rhino.GetInteger ("enter v division number",10)
'call the function to evaluate the surface
Dim uvPt
uvPt = srfPt(srf, uRes, vRes)
Dim m
Dim n
Dim myCell
For m = 0 To uRes-1
For n = 0 To vRes-1
'cell is the fucntion defined at the bottom of the code
myCell = cell(uvPt(m,n),uvPt(m+1,n),uvPt(m+1,n+1),uvPt(m,n+1),floor((m+n)/4)+4 )
Next
Next
End Sub
Function srfPt(iSrf, iUNum, iVNum) 'inputs
'define domain variables
Dim domU_iSrf
Dim domV_iSrf
'find surface domain
domU_iSrf = Rhino.SurfaceDomain (iSrf,0)
domV_iSrf = Rhino.SurfaceDomain (iSrf,1)
'define uv parameter variables
Dim uParam
Dim vParam
Dim uvParam
'define variable For surface points
Dim pt
'convert pt into an array
ReDim pt(iuNum, ivNum)
Dim i,j
For i = 0 To iuNum
For j = 0 To ivNum
uParam = (domU_iSrf(1)/iuNum)*i
vParam = (domV_iSrf(1)/ivNum)*j
uvParam = Array(uParam,vParam)
pt(i,j) = rhino.EvaluateSurface (iSrf, uvParam)
rhino.AddPoint pt(i,j)
Next
Next
srfPt = pt
End Function
'this function creates a cell
Function cell(pt1,pt2,pt3,pt4,cellDiv)
Dim border
border = rhino.AddPolyline (Array(pt1,pt2,pt3,pt4,pt1))
rhino.ObjectLayer border, "border"
Dim divPts
divPts = Rhino.DivideCurve (border, cellDiv)
'rhino.Print UBound(divPts)
ReDim Preserve divPts(cellDiv)
divPts(cellDiv) = divPts(0)
Dim cellCrv
cellCrv = rhino.addCurve (divPts)
rhino.ObjectLayer cellCrv, "cell"
End Function
evaluate Surface: UV grid [class 20091208/11]
•2009/12/12 • Leave a Commentscript below evaluates a surface and creates a UV point grid on it.
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Friday, December 11, 2009 11:25:09 AM
Call Main()
Sub Main()
'get input surface
Dim srf
srf = Rhino.GetObject("select surface",8)
'get the division numbers for U and v directions
Dim uRes
Dim vRes
uRes = rhino.GetInteger ("enter u division number",10)
vRes = rhino.GetInteger ("enter v division number",10)
'call the function to evaluate the surface
Dim uvPt
uvPt = srfPt(srf, uRes, vRes)
End Sub
Function srfPt(iSrf, iUNum, iVNum) 'inputs
'define domain variables
Dim domU_iSrf
Dim domV_iSrf
'find surface domain
domU_iSrf = Rhino.SurfaceDomain (iSrf,0)
domV_iSrf = Rhino.SurfaceDomain (iSrf,1)
'define uv parameter variables
Dim uParam
Dim vParam
Dim uvParam
'define variable For surface points
Dim pt
'convert pt into an array
ReDim pt(iuNum, ivNum)
'evaluate the surface
'at given parameters
'to generate a UV grid
Dim i,j
For i = 0 To iuNum
For j = 0 To ivNum
uParam = (domU_iSrf(1)/iuNum)*i
vParam = (domV_iSrf(1)/ivNum)*j
uvParam = Array(uParam,vParam)
pt(i,j) = rhino.EvaluateSurface (iSrf, uvParam)
rhino.AddPoint pt(i,j)
Next
Next
srfPt = pt
End Function
evaluate Curve [class 20091208/11]
•2009/12/12 • Leave a Commentyou can mark/find points on a curve at a given parameter by using it’s domain.
curve domain could be though as the “(mathematical) definition space” of the curve.
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Friday, December 11, 2009 10:54:39 AM
Call Main()
Sub Main()
'get the curve
Dim crv
crv = rhino.Getobject ("select curve")
'find the curve domain
'(refer to rhinoscript help file
Dim domCrv
domCrv = rhino.CurveDomain (crv)
'evaluate the curve at a given parameter
Dim pt
pt = Rhino.EvaluateCurve (crv,domCrv(1)*0.5)
rhino.addPoint pt
End Sub
arithmetic Mean, one liner [class 20091208/11]
•2009/12/12 • Leave a CommentOption Explicit 'Script written by onur yuce gun 'Script copyrighted by 'Script version Friday, December 11, 2009 10:21:04 AM Call Main() Sub Main() 'call the function rhino.Print calcMean(26,8) End Sub Function calcMean(num1,num2) Dim sum sum = num1 + num2 calcMean = sum/2 End Function
arithmetic Mean [class 20091208/11]
•2009/12/12 • Leave a Comment
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Friday, December 11, 2009 10:21:04 AM
Call Main()
Sub Main()
Dim integer1
Dim integer2
'get two numbers as user input
integer1 = rhino.GetInteger ("enter the first integer")
integer2 = rhino.GetInteger ("enter the second integer")
Dim result
'call the calcMean function
result = calcMean(integer1,integer2)
rhino.Print result
End Sub
'function below gets two numbers
'and RETURNS the arithmetic mean of these numbers
Function calcMean(num1,num2)
Dim sum
sum = num1 + num2
calcMean = sum/2
End Function
cap planar Holes [class 20091201]
•2009/12/02 • Leave a Commentduzlemsel kapali egriyi extude ve cap eden kisa bir script.
Option Explicit
'Script written by
'Script copyrighted by
'Script version Monday, November 30, 2009 3:10:31 PM
Call Main()
Sub Main()
Dim crv
Dim srf
Dim cap
Dim path
path = Rhino.AddLine (Array(0,0,0), Array(0,0,10))
crv = Rhino.GetObject ("get closed curve")
srf = Rhino.ExtrudeCurve (crv,path)
Rhino.CapPlanarHoles srf
End Sub
curve Mid Point [class 20091201]
•2009/12/02 • Leave a Commentfinds and copies the mid point of a curve.
might be useful for carrying/copying a curve in reference to itself.
Option Explicit
'Script written by
'Script copyrighted by
'Script version Tuesday, December 01, 2009 12:31:41 PM
Call Main()
Sub Main()
Dim crv
Dim mPt
crv = rhino.getobject ("select curve")
mPt = Rhino.CurveMidPoint (crv)
rhino.Print mPt(0)
rhino.AddPoint mPt
Dim ePt
Dim i
for i = 0 To 10
ePt = array(mPt(0),mPt(1),mPt(2)+3*i)
rhino.addPoint ePt
Next
End Sub
influence Curve [class 20091124]
•2009/12/01 • Leave a Commentthis script populates a section over a rail curve.
each section is positioned and scaled according to the distance of the position of the section to the influence curve.
a loft surface is added to the curves at the end of the script
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Tuesday, November 24, 2009 12:35:46 PM
Call Main()
Sub Main()
Dim rail
Dim infC
Dim fig
rail = rhino.GetObject("select the rail curve")
infC = rhino.GetObject("select the influence curve")
fig = rhino.GetObject("select figure")
'number of sections to be copied
Dim res
res = 20
Dim railPt
Dim infPt
'divide both curves
railPt = Rhino.DivideCurve (rail, res,True)
infPt = rhino.DivideCurve (infC, res,True)
Dim dist
ReDim dist(res)
Dim cFig
ReDim cFig(res)
'copy and scale figures depending on division point distances
Dim i
For i = 0 To res
dist(i) = Rhino.Distance (railPt(i), infPT(i))
cFig(i) = rhino.CopyObject (fig, array(0,0,0), infPt(i))
rhino.ScaleObject cFig(i),railPt(i),array(dist(i)/10,dist(i)/10,dist(i)/10)
Next
'add loft surface to section curves
rhino.AddLoftSrf cFig
End Sub
curve Extrusion [class 20091124]
•2009/12/01 • Leave a Comment
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Tuesday, November 24, 2009 10:42:23 AM
Call Main()
Sub Main()
'create the 2D arrays for
'point grids and distances
Dim ptGrid
ReDim ptGrid(9,9)
Dim dists
ReDim dists(9,9)
Dim vLines
ReDim vLines(9,9)
'select the location of attractor point
Dim attPt
attPt = Rhino.GetPoint ("select the attractor point")
'select a section profile
Dim sec
sec = rhino.GetObject ("sel profile")
Dim currSec
Dim divPt
'actual position of each point in the grid
Dim posX, posY
Dim i,j
For i = 0 To 9
For j = 0 To 9
posX = i*4
posY = j*4
'place the points in the grid
ptGrid (i,j) = Array(posX,posY,0)
'check distance
dists (i,j) = rhino.Distance (ptGrid(i,j), attPt)
rhino.Print dists(i,j)
'draw a vertical line depending on the distance
vLines(i,j) = rhino.AddLine (ptGrid(i,j), array(posX,posY,dists(i,j)*dists(i,j)/40))
currSec = rhino.CopyObject (sec, array(0,0,0), ptGrid(i,j))
If dists(i,j) > 2 Then
divPt = Rhino.DivideCurve (currSec, floor(dists(i,j)), True)
Else
divPt = Rhino.DivideCurve (currSec, 2, True)
End If
currSec = rhino.AddCurve (divPt)
rhino.ExtrudeCurve currSec, vLines(i,j)
rhino.AddPoint ptGrid (i,j)
Next
Next
End Sub
attractor Point [class 20091124]
•2009/12/01 • Leave a Commentthis script draws vertical lines on a regular grid.
line lengths are adjusted according to the distance of each grid point to the attractor point.
Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Tuesday, November 24, 2009 10:42:23 AM
Call Main()
Sub Main()
'create the 2D arrays for
'point grids and distances
Dim ptGrid
ReDim ptGrid(9,9)
Dim dists
ReDim dists(9,9)
'select the location of attractor point
Dim attPt
attPt = Rhino.GetPoint ("select the attractor point")
'actual position of each point in the grid
Dim posX, posY
Dim i,j
For i = 0 To 9
For j = 0 To 9
posX = i*2
posY = j*2
'place the points in the grid
ptGrid (i,j) = Array(posX,posY,0)
'check distance
dists (i,j) = rhino.Distance (ptGrid(i,j), attPt)
rhino.Print dists(i,j)
'draw a vertical line depending on the distance
rhino.AddLine ptGrid(i,j), array(posX,posY,dists(i,j))
rhino.AddPoint ptGrid (i,j)
Next
Next
End Sub
2D Number Array [class 20091124]
•2009/12/01 • Leave a CommentDim myNum ReDim myNum (3,3) Dim i,j For i = 0 To 3 For j = 0 To 3 myNum(i,j) = j+(i*10) rhino.Print myNum(i,j) Next Next
math Form [class 20091117]
•2009/11/24 • Leave a CommentOption Explicit 'Script written by onur yuce gun 'Script copyrighted by 'Script version Friday, November 20, 2009 11:35:19 AM Call Main() Sub Main() 'function used in rib creation 'x = a(3cos(t) - cos(3t)), y = a(3sin(t) - sin(3t)) Dim x,y,z Dim a,t Dim myParam Dim flPt ReDim flPt(0) Dim cntPt cntPt = 0 Dim allCrv ReDim allCrv(0) Dim cntCrv cntCrv = 0 a = 1 z = 0 For myParam = 4 To 6 Step 0.025 'loop for one single curve For t=0 To 2*Rhino.PI Step 0.1 x = a*(myParam*cos(t)-cos(myParam*t)) y = a*(3*sin(t)-sin(3*t)) ReDim Preserve flPt (cntPt) flPt(cntPt) = array(x,y,z) 'rhino.AddPoint flPt(cntPt) cntPt = cntPt + 1 Next ReDim Preserve allCrv(cntCrv) allCrv(cntCrv) = rhino.addCurve (flPt) cntCrv = cntCrv+1 cntPt = 0 z = z+1 Next 'add loft to all curves rhino.AddLoftSrf allCrv End Sub
mathematical Monster [submission]
•2009/11/11 • Leave a Commentcurve equations – generating “rib” curves [class 20091111]
•2009/11/11 • Leave a CommentFOLLOWING SCRIPT IS AN UPDATE FROM PREVIOUS POST.
NOTE THAT YOU CAN CREATE DETACHED CURVES INSTEAD OF A CONTINUOUS ONE.
THIS WOULD HELP YOU IN GENERATING SURFACES BY LOFTING.
Option Explicit 'Script written by onur yuce gun 'Script copyrighted by 'Script version Wednesday, November 11, 2009 10:18:50 PM Call Main() Sub Main() 'define variables Dim x,y,z,a,b,c,n,t,i a = 1 c = 10 n = 2 z = 0 i = 0 'array to hold points in one "row" Dim allPt ReDim allPt(0) 'array to hold all curves Dim allCrv ReDim allCrv(0) 'variable to count the number of curves Dim cntCrv cntCrv = 0 For b = 1 To 8 Step 0.5 a = sqr(b) 'this for loop draws one row of points 'and puts those points into the point array For t = 0 To rhino.Pi Step 0.05 z = z + 0.002 x = a*sin(n*t + c) y = b*sin(t) ReDim Preserve allPt(i) allPt(i) = array (x,y,z) rhino.AddPoint allPt(i) i = i+1 Next 'now it's time to expand the curve array 'and add the new curve for the new "row" of points ReDim Preserve allCrv(cntCrv) allCrv(cntCrv) = rhino.addcurve (allPt) cntCrv = cntCrv+1 'here we have to reset the point array 'so we can start the next curve as a seperate one i = 0 Next 'finally we can add a loft surface using all curves rhino.AddLoftSrf allCrv End Sub
discovering equations
•2009/11/08 • Leave a Commenthave a look at the “famous curves index” website below and have a look at the curve types.
then play with the equations and see what type of forms you can generate:
lissajous curve equation generated an interesting climbing curve after several modifications.
here is a script that generates a ‘mathematical monster’:
Option Explicit 'Script written by onur yuce gun 'Script copyrighted by 'Script version Sunday, November 08, 2009 1:40:25 PM Call Main() Sub Main() Dim x,y,z,a,b,c,n,t Dim pt 't = rhino.Pi a = 1 c = 10 n = 2 z = 0 For b = 1 To 8 Step 0.5 a = sqr(b) For t = 0 To rhino.Pi Step 0.05 z = z + 0.002 x = a*sin(n*t + c) y = b*sin(t) pt = array (x,y,z) rhino.AddPoint pt Next Next End Sub
same script, modified to add a curve using all points:
Option Explicit 'Script written by onur yuce gun 'Script copyrighted by 'Script version Sunday, November 08, 2009 1:40:25 PM Call Main() Sub Main() Dim x,y,z,a,b,c,n,t,i a = 1 c = 10 n = 2 z = 0 i = 0 Dim allPt ReDim allPt(0) For b = 1 To 8 Step 0.5 a = sqr(b) For t = 0 To rhino.Pi Step 0.05 z = z + 0.002 x = a*sin(n*t + c) y = b*sin(t) ReDim Preserve allPt(i) allPt(i) = array (x,y,z) rhino.AddPoint allPt(i) i = i+1 Next Next rhino.addcurve allPt End Sub
sinus Curve [class 20091103]
•2009/11/08 • Leave a Commentthis script will help you draw sinus curves.
your HOMEWORK is to draw other mathematical curves and create various configurations with these curves.
adding surfaces via use of Rhino.AddLoftSrf command is a plus.
Option Explicit 'Script written by 'Script copyrighted by 'Script version Tuesday, November 03, 2009 11:18:39 AM Call Main() Sub Main() 'define variables Dim x Dim y Dim i Dim frq 'frequency Dim pt 'point ReDim pt(0) 'covert variable into an array Dim cnt 'point count 'point count is 'zero at the beginning' cnt = 0 'frequency 'read more about frequency here: 'http://en.wikipedia.org/wiki/Frequency frq = 1 For i = 0 To 20 Step 0.4 x = i y = sin(i*frq) 'expand the array to store the current point 'but store the previous values, too ReDim Preserve pt(cnt) pt(cnt) = array(x,y,0) 'add the point in 3D space rhino.addpoint pt(cnt) 'increse the point count by 1 cnt=cnt+1 Next 'add a curve using all points in the array rhino.addcurve pt rhino.Print UBOund(pt) End Sub
number Array [class 20091103]
•2009/11/08 • Leave a CommentOption Explicit 'Script written by 'Script copyrighted by 'Script version Tuesday, November 03, 2009 11:42:57 AM 'THIS SCRIPT CREATES AND STORES AN ARRAY OF NUMBERS 'ALL THE NUMBERS ARE PRINTED IN THE COMMAND LINE 'FIRST NUMBER AND INCREMENT CAN BE ADJUSTED Call Main() Sub Main() 'array to hold the numbers (size is 100) Dim num ReDim num(99) 'define the first number and increment Dim fnum fnum = 5 Dim inc inc = 2 'place the numbers in the array Dim i For i=0 To UBound(num) num(i) = fnum + (inc*i) rhino.print num(i) Next End Sub notes: the numbers generated are 5,7,9,11,13.....,203 one single variable, "num" stores all the numbers. "reDim" command help us define "num" as an array. if you want to access the first number in the list, you call num(0) if you want to access the fourth number, which is 11, you call num(3) for more information about arrays, refer to rhinoScript_101
Centric Figures (continued) [class 20091027]
•2009/10/31 • Leave a Commentpossibilities are infinite!
try to see how you can manipulate your code to make it do what you want.
1. manipulate your code
2. generate centric figures on a 3D grid (at least 4 x 4 x 4) (four by four by four figures)
3. tell us how your figures update
4. tell us which figures you like
5. tell us why
here are the figures on a 2D grid of 4 x 7 (four by seven figures)
the code below can create these figures with very simple additions.
hints for 3D grid are included in the script.
Option Explicit
'THIS SCRIPT WILL HELP YOU FIGURING YOUR WAY OUT TO GENERATE CENTRIC FIGURES
'IN A 3D GRID.
'PLEASE READ AND USE IT!!!!
'Script written by
'Script copyrighted by
'Script version Tuesday, October 27, 2009 11:06:28 AM
Call Main()
Sub Main()
'get curves as input
Dim crv1, crv2, crv3
crv1 = Rhino.GetObject ("select curve 1")
crv2 = Rhino.GetObject ("select curve 2")
crv3 = Rhino.GetObject ("select curve 3")
Dim selNum 'randomized selection number
Dim selCrv01 'original selected curve
Dim selCrv01St 'original curve start point
Dim currCrv 'current leaf on grid point
Dim currCrvRot 'rotated current leaf on grid point
Dim currAng 'lear angle
Dim currPNum 'leaf number
'create the grid points
Dim xSpan, ySpan, spanF
Dim pos
xSpan = 6
ySpan = 3
spanF = 20
'variables for counters
Dim i, j, k
'two for loops determine the size of the grid
'IF YOU WRITE AN ADDITIONAL FOR LOOH HERE
'AND EMBED ALL OTHER FOR LOOPS
'YOU CAN GENERATE A 3D GRID: THIS IS YOUR HOMEWORK
For j = 0 To ySpan
For i = 0 To xSPan
pos = Array(i*spanF,j*spanF,0)
rhino.AddPoint pos
'a random selection number
selNum = Rnd()
Rhino.Print selNum
'depending on the number one of the three curves is selected randomly
If selNum < 0.33 Then
selCrv01 = crv1
ElseIf (0.33 < selNum) And (selNum 0.66 Then
selCrv01 = crv3
End If
'grab the selected curve and paste it to its location in the grid
selCrv01St = Rhino.CurveStartPoint(selCrv01)
currCrv = Rhino.CopyObject (selCrv01, selCrv01St, pos)
'define the peatl number for each centric figure
currPNum = 8+(i*3)
currAng = 360/currPNum
For k = 0 To currPNum-1
currCrvRot = rhino.RotateObject (currCrv, pos, currAng*k,,True)
'PLAY WITH THE SCALE VALUES HERE AND YOUR WILL GENERATE SOME VARIATION
rhino.ScaleObject currCrvRot, pos, Array(0.5*(j+1)/2,0.5*(j+1)/2,1)
Next
Rhino.HideObject (currCrv)
Next
Next
End Sub
Centric Figures :: Submissions
•2009/10/28 • Leave a CommentROUND 2 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ROUND 1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Centric Figures [class 20091020]
•2009/10/23 • Leave a Comment
Option Explicit
'Script written by
'Script copyrighted by
'Script version Tuesday, October 20, 2009 12:16:54 PM
Call Main()
Sub Main()
'variables for curves
Dim c1
Dim c2
Dim c3
'curve start points
Dim c1S
Dim c2S
Dim c3S
'center point
Dim cePt
'select the curves to use in rotation
c1 = rhino.GetObject ("select curve 01",4)
c2 = rhino.GetObject ("select curve 02",4)
c3 = rhino.GetObject ("select curve 03",4)
c1S = rhino.CurveStartPoint (c1)
c2S = rhino.CurveStartPoint (c2)
c3S = rhino.CurveStartPoint (c3)
'pick the center of rotation
cePt = rhino.GetPoint ("select the center point")
'copy a curve to center point (you can copy one of the other curves here)
Dim leaf
leaf = rhino.CopyObject (c2, c2s, cePt)
'scale the copied curve (you can use one of the other curves here)
Dim leafScale
leafScale = rhino.ScaleObject (leaf, cePt, array(0.8,0.8,0.8), True)
'enter the petal number and rotation value
Dim pNum
Dim rAng
pNum = 20
rAng = 360/pNum
Dim i
'rotate the curves around the center
For i = 0 To pNum
rhino.RotateObject leaf, cePt, i*rAng, ,True
rhino.RotateObject leafScale, cePt, i*rAng, ,True
Next
'PLEASE USE THIS SCRIPT AS A TEMPLATE TO >
'GENERATE DIFFERENT CENTRIC FIGURES. >
'USE DIFFERENT CURVE COMBINATIONS TO GENERATE VARIATION >
'PREPARE -at least- 10 FIGURES AND >
'CREATE A BOARD INCLUDING IMAGES, CURVE TYPES AND PARAMETERS >
'THAT ARE USED TO GENERATE THOSE FIGURES.
End Sub



































![onuryucegun_20091027_centricFigsRandom [Converted] copy onuryucegun_20091027_centricFigsRandom [Converted] copy](http://arch571.files.wordpress.com/2009/10/onuryucegun_20091027_centricfigsrandom-converted-copy.jpg?w=497&h=288)










