Notifications
Clear all
[Closed] Stepped array 1 to 66 or more
Feb 08, 2008 8:23 pm
i’ve been trying awhile to make a stepped array, is it possible or am i over thinking it?
thanks for any help
7 Replies
Feb 08, 2008 8:23 pm
here’s what i got crude so far.
rollout SPosts "W Racks ver. 2.8.08"
(
spinner num4 "Hoz spacing" type:#float range:[2,10,4.5]
spinner num1 "vert spacing" type:#float range:[2,10,3.75]
spinner num2 "Columes" type:#integer range:[1,75,10]
spinner num3 "Rows Drop" type:#integer range: [1,4,1]
spinner num5 "deep" type:#integer range: [1,3,1]
spinner num6 "nothing" type:#integer range:[1,75,11]
label lab1 "__________________________________________" button create "Make Them"
on create pressed do
undo off
(
gg1 = num1.value+.68
gg2 = num2.value
gg3 = num3.value
gg4 = num4.value
gg5 = num5.value*10.5
gg6 = num6.value*gg1
(
)
for i = 1 to gg2 do
(
gbox = box()
gbox.length =1.375
gbox.width = .68
gbox.height = i*gg1*gg3
gbox.position.x = i * gg4
)
for k = 1 to gg2 do
(
gbox = box()
gbox.length =1.375
gbox.width = .68
gbox.height = k*gg1*gg3
gbox.position.x = k * gg4
gbox.position.y = gg5
)
for h = 1 to 2 do
(
gbox = box()
gbox.length =1.375
gbox.width = gg2*gg4-gg4+.50
gbox.height = .68
gbox.position.x = (gg2*gg4)/2+(gg4/2)
gbox.position.y = h*(-gg5-1.375)+gg5+1.375-(-gg5-1.375)-.68
)
for j = 1 to gg2-1 do
(
gbox = box()
gbox.length =1.375
gbox.width = gg4+.68
gbox.height = .68
gbox.position.x = j * gg4+(gg4/2)
gbox.position.z = j * gg3*gg1-.68
gbox.position.y = gg5-gg5-.68
)
for j1 = 1 to gg2-1 do
(
gbox = box()
gbox.length =1.375
gbox.width = gg4+.68
gbox.height = .68
gbox.position.x = j1 * gg4+(gg4/2)
gbox.position.z = j1 * gg3*gg1-.68
gbox.position.y = gg5+.68
)
for j2 = 1 to gg2-1 do
(
gbox = box()
gbox.length =10.5
gbox.width = .68
gbox.height = .68
gbox.position.x = j2 * gg4+.68
gbox.position.z = j2 * gg3*gg1-.68
gbox.position.y = (gg5/2)
)
for j3 = 1 to gg2-1 do
(
gbox = box()
gbox.length =10.5
gbox.width = .68
gbox.height = .68
gbox.position.x = j3 * gg4+gg4-.68
gbox.position.z = j3 * gg3*gg1-.68
gbox.position.y = (gg5/2)
)
for j3 = 1 to gg2-1 do
for j4 = 1 to gg2-1 do
(
rail3 = splineshape()
addnewspline rail3
addknot rail3 1 #corner #curve [5.52,gg5,-gg1]
addknot rail3 1 #corner #curve [4.84,gg5,-gg1]
addknot rail3 1 #corner #curve [4.84,0,-gg1]
addknot rail3 1 #corner #curve [5.52,.68,-gg1]
rail3.steps = 0
close rail3 1
updateshape rail3
rail3.name = "rail_a"
addModifier rail3 (extrude amount:.68 segs:1)
rail3.position.x = j3 * gg4+gg4-gg4-gg4
rail3.position.z = j4 * gg1-.68
)
for j3 = 1 to gg2-1 do
for j4 = 1 to gg2-1 do
(
rail4 = splineshape()
addnewspline rail4
addknot rail4 1 #corner #curve [7.98,gg5,-gg1]
addknot rail4 1 #corner #curve [8.66,gg5,-gg1]
addknot rail4 1 #corner #curve [8.66,0,-gg1]
addknot rail4 1 #corner #curve [7.98,.68,-gg1]
rail4.steps = 0
close rail4 1
updateshape rail4
rail4.name = "rail_b"
addModifier rail4 (extrude amount:.68 segs:1)
rail4.position.x = j3 * gg4+gg4-gg4-gg4
rail4.position.z = j4 * gg1-.68
)
)
)
createDialog SPosts width:225 height: 180 bgcolor:(color 60 0 25) fgcolor:(color 255 255 255)
Feb 08, 2008 8:23 pm
How about this? Will give you the same structure…
for a=1 to 20 do
(
for b=1 to a do
(
box size:[10,10,10] pos:[a*45,b*45,0] wirecolor:blue
)
)
Feb 08, 2008 8:23 pm
ps, shorter
for a=1 to 20 do (
for b=1 to a do
box size:[10,10,10] pos:[a*45,b*45,0] wirecolor:blue
)
Feb 08, 2008 8:23 pm
Actually it’s a one liner… I spread it out for clairity…
[left]for a=1 to 20 do (for b=1 to a do(box size:[10,10,10] pos:[a45,b45,0] wirecolor:blue))[/left]
[left]:-)[/left]
[left]“Do in one line, that which others do all day…” – Keith Morrison[/left]
[left]Just made that up…[/left]
Feb 08, 2008 8:23 pm
thanks for the help but they are not boxes.
for a=1 to 20 do (for b=1 to a do(box size:[10,10,10] pos:[a45,b45,0] wirecolor:blue))
for a=1 to 20 do (for b=1 to a do( insert myslpine paremeters here? ))
rail4 = splineshape()
addnewspline rail4
addknot rail4 1 #corner #curve [7.98,gg5,-gg1]
addknot rail4 1 #corner #curve [8.66,gg5,-gg1]
addknot rail4 1 #corner #curve [8.66,0,-gg1]
addknot rail4 1 #corner #curve [7.98,.68,-gg1]
rail4.steps = 0
close rail4 1
updateshape rail4
rail4.name = "rail_b"
addModifier rail4 (extrude amount:.68 segs:1)
Feb 08, 2008 8:23 pm
I think I got it, thanks for the direction and help.
)
for j3 = 1 to gg2-1 do
(
for j4 = 1 to j3 do
(
rail4 = splineshape()
addnewspline rail4
addknot rail4 1 #corner #curve [3.48,gg5,-gg1]
addknot rail4 1 #corner #curve [4.16,gg5,-gg1]
addknot rail4 1 #corner #curve [4.16,0,-gg1]
addknot rail4 1 #corner #curve [3.48,.68,-gg1]
rail4.steps = 0
close rail4 1
updateshape rail4
rail4.name = "rail_b"
addModifier rail4 (extrude amount:.68 segs:1)
rail4.position = [j3 *gg4,0,j4 *gg1]
)