29.4.09
13.4.09
Easter Egg
This is just for laughs, nothing serious, ok? Had some fun doing this small Easter Script.
1. Create a sphere in Rhino and stretch its control points to turn it into an egg
2. run the script below
3. Happy Easter!
Here's the script:
Option Explicit
'
'
'
' . Easter Stripe Egg
' . script written by Alessio Erioli
' .
' . v. 12 April 2009 + 22:05:27
' . © Alessio Erioli
' . monkey Rulez, so play by the rulez.
'____________________________________________________________________________________
Call Easteregg()
Sub Easteregg()
' input surface and division intervals
Dim strSurf: strSurf=Rhino.GetObject("select a surface",8)
' vertical subdivision intervals (<=200, otherwise sweep fails)
Dim intVInt: intVInt=Rhino.GetInteger("n. of V intervals?",200,10)
'lights off!
Rhino.EnableRedraw False
' get surface domain (u and v)
Dim arrUdom,arrVdom, zminPt, zmaxPt
arrUdom = Rhino.SurfaceDomain(strSurf,0)
arrVdom = Rhino.SurfaceDomain(strSurf,1)
' get zmin and zmax points
zminPt=Rhino.EvaluateSurface(strSurf,array(arrUdom(0),arrVdom(0)))
zmaxPt=Rhino.EvaluateSurface(strSurf,array(arrUdom(0),arrVdom(1)))
Dim i, inc, angInc, ang, arrPt, arrPt2, vect, strCrv
Dim arrPts: ReDim arrPts(intVint)
' hetght and angle increments
inc = (zmaxPt(2)-zminPt(2))/intVint
angInc = 180/5
ang = 0
For i = 0 To IntVint
' point along vertical
arrPt= array (zminPt(0),zminPt(1),zminPt(2)+(i*inc))
' second point for vector construction
arrPt2 = array (zminPt(0)+1,zminPt(1),zminPt(2)+(i*inc))
' vector construction and rotation
vect= Rhino.VectorCreate(arrPt, arrPt2)
vect=Rhino.VectorRotate(vect,ang+i*angInc,array(0,0,1))
' projects point to surface
arrPts(i)=Rhino.ProjectPointToSurface(arrPt,strSurf, vect)(0)
If Isnull(arrPts(i)) Then
arrPts(i)=arrPt
End If
Next
' create base curve
strCrv = Rhino.AddInterpCurve(arrPts,3)
Dim arrPlane,arrCircles, dblrad
ReDim arrCircles(intVint)
' create circular sections along curve
For i=0 To intVint
arrPlane=Rhino.CurvePerpFrame(strCrv,Rhino.CurveClosestPoint(strCrv,arrPts(i)))
dblrad=sin(i*pi/intVint)+0.001
arrCircles(i)=Rhino.AddCircle(arrPlane,dblrad)
Next
' add a sweep 1 rail surface
Call Rhino.Addsweep1(strCrv, arrCircles)
' hide unnecessary elements
Rhino.HideObject strCrv
Rhino.HideObject strSurf
Rhino.HideObjects arrCircles
' lights on!
Rhino.EnableRedraw True
End Sub
k.words:
Easter,
fun,
RhinoScript
2.4.09
Rhinoscript new release
A new version of Rhinoscript is available for download, in order to accomplish the changes and fixes of Rhino 4.0 SR 5.
Download it from RhinoLabs page:
http://en.wiki.mcneel.com/default.aspx/McNeel/RhinoScriptLabs.html
Download it from RhinoLabs page:
http://en.wiki.mcneel.com/default.aspx/McNeel/RhinoScriptLabs.html
k.words:
RhinoScript
Grasshopper manuals - IMPORTANT RELEASES
1. Andrew Payne from LIFT architects has released a new update of his Grasshopper Primer. Rajaa Issa has given a huge contribution in this issue, and the most important feature is a section dedicated to VB.net scripting in Grasshopper. Download it here:
http://www.liftarchitects.com/journal/2009/3/25/the-grasshopper-primer-second-edition.html
2. Mohamad Khabazi has released an impressive 180 pages guide to algorithmic modeling in Grasshopper based on the studies at EmTech AA made in fall 2008, a must for architectural exploration with this tool. Download it here:
http://blog.rhino3d.com/2009/04/algorithmic-modelling-with-grasshopper.html
Enjoy!!!
k.words:
Grasshopper
Subscribe to:
Posts (Atom)