ESSAIS 3 mars 2008
j’essai maintenant de faire que les boites soit ouvertes sur les cotés ou elles se touchent.
j’ai réussi pour l’instant qu’à le faire manuellement.
je ne sais pas comment le faire sur l’axe des X et Y, car lorsqu’elles s’ouvrent sur les X, les deux rangées dans les Y s’ouvrent sur le mauvais coté.
voici une image d’un de mes rendus sur Rhino.
I try now with open boxes, like that, the pavilion is totally transparent. and I remove the side where boxes touch each others.
i did it manually only, not with the script.
in fact I don’t know how to do it in the script, because when i open them in the X position, boxes which are on the Y position open in the wrong side…
so this is one of my renders in Rhino, with Vray.
Si un de vous a une idée pour résoudre mon problème.
If one of you had any idea to resolve my problem.
SCRIPT :: branches et carrés central 3 mars 2008
Option Explicit
‘Script written with Marius Watz
‘modified by Baptiste Marconnet
‘Script version 20. februar 2008
Call Clear
Call Main()
Sub Main()
Dim light
‘light=Rhino.AddPointLight (Array(0,-200,0))
light=Rhino.AddPointLight (Array(0,100,200))
Rhino.RenderColor 1, RGB(25,50,124)
Rhino.RenderResolution Array(1200,900)
Rhino.RenderAntialias 2
Call Rhino.enableRedraw(False)
Dim i,j
For i=0 To 0
For j=-6 To -2
Call rndCube(i*10,j*10)
Next
Next
Call Rhino.enableRedraw(True)
Call Rhino.enableRedraw(False)
Dim k,l
For k=0 To 0
For l=2 To 6
Call rndCube(k*10,l*10)
Next
Next
Call Rhino.enableRedraw(True)
Call Rhino.enableRedraw(False)
Dim m,n
For m=2 To 6
For n=0 To 0
Call rndCube(m*10,n*10)
Next
Next
Call Rhino.enableRedraw(True)
Call Rhino.enableRedraw(False)
Dim o,p
For o=-6 To -2
For p=0 To 0
Call rndCube(o*10,p*10)
Next
Next
Call Rhino.enableRedraw(True)
Dim q,r
For q=-0.5 To 0.5
For r=-0.5 To 0.5
Call rndCube(q*10,r*10)
Next
Next
Call Rhino.enableRedraw(True)
End Sub
Function rndVec(range)
rndVec=Array(Rnd*range-range/2,Rnd*range-range/2,Rnd*range-range/2)
End Function
Function rndCube(xpos,ypos)
Dim pt(8)
Dim c1,c2
Dim rad
rad=5
pt(0)=Array(-rad,-rad,rad)
pt(1)=Array(rad,-rad,rad)
pt(2)=Array(rad,rad,rad)
pt(3)=Array(-rad,rad,rad)
pt(4)=Array(-rad,-rad,-rad)
pt(5)=Array(rad,-rad,-rad)
pt(6)=Array(rad,rad,-rad)
pt(7)=Array(-rad,rad,-rad)
Dim i,rndv,rndH
rndH=Rnd*rad*2
Dim zpos
zpos=Rnd*3*rad
For i=0 To 3
rndv=rndVec(4)
rndv(2)=rndv(2)+rndH
pt(i)=Rhino.VectorAdd(pt(i),rndv)
Next
For i=0 To 7
pt(i)=Rhino.VectorAdd(pt(i),Array(xpos,ypos,zpos))
Next
Dim ln(8)
For i=0 To 3
ln(i)=Rhino.AddLine(pt(i),pt((i+1) Mod 4))
ln(i+4)=Rhino.AddLine(pt(i+4),pt(((i+1) Mod 4)+4))
Next
Dim srf(6)
For i=0 To 3
srf(i)=Rhino.AddEdgeSrf(Array(ln(i),ln(i+4)))
Next
ln(0)=Rhino.AddLine(pt(1),pt(0))
srf(4)=Rhino.AddEdgeSrf(Array(ln(0),ln(2)))
srf(5)=Rhino.AddEdgeSrf(Array(ln(6),ln(4)))
For i=0 To UBound(ln)-1
Rhino.DeleteObject ln(i)
Next
End Function
Sub Clear
Rhino.Command “SelAll “
Rhino.Command “Delete “
End Sub



























