11 February 2009

Zeropavilion02

Honeycomb panels 04




Optimization of last Honeycomb rhinoscript.
Now the script works with IsoCurve surface, in this case the honeycomb pattern follow the curvature of the input surface. Pattern now results more interesting than the last version.
I've found the main part of code for extract isocurve into Monkey :

-----------------------------------------------
strObject = Rhino.GetObject("Select surface for isocurve extraction", rhObjectSurface)
For i=0 To 100
arrPoint = Rhino.GetPointOnSurface(strObject, "Select from left to right o viceversa 10 location points on surface for extraction")


arrParameter = Rhino.SurfaceClosestPoint(strObject, arrPoint)

Rhino.ExtractIsoCurve strObject, arrParameter , 1

Next

------------------------------------

Change integer 100 with your preferences, it's the number of isocurve extracted. The parameter 1 at last string is 1 for V isocurve, 0 for U isocurve and 2 for both.

The script also hide the input surface and the isocurve extracted.

02 February 2009

Rhinoscript diagrid 01.



Diagrid version of last honeycomb pattern script.

Rhino.addLine arrPoints(i)(j+1),arrPoints(i+2)(j)
Rhino.addLine arrPoints(i+2)(j),arrPoints(i+4)(j+1)
Rhino.addLine arrPoints(i+4)(j+1),arrPoints(i+2)(j+2)
Rhino.addLine arrPoints(i+2)(j+2),arrPoints(i)(j+1)

30 January 2009

Honeycomb panels 03


Honeycomb tesselation rhinoscript optimized:
-contouring curves created by rhinoscript
-equal distance of contouring curves is variable
-selection of curves more fast, not one by one
-number of division points is variable
-more fast honeycomb construction

Option Explicit
' Author: Milutin Cerovic 2009
' www.4ofseven.com
' adapted:http://www.madeincalifornia.blogspot.com/
Call Main()
Sub Main()
'---------------------
'declare variables
'---------------------
Dim arrPoints
Dim i,j
Dim strObject, arrStartPoint, arrEndPoint, arrContours, divnumber
Dim arrIsoCurves
Const rhObjectCurve = 4
'---------------------
'select surface or Polysurface
'---------------------
strObject = Rhino.GetObject("Select object", rhObjectSurface + rhObjectPolysurface)
'define plane of section
'---------------------
arrStartPoint = Rhino.GetPoint("select contour base plane startpoint")
arrEndPoint = Rhino.GetPoint("select contour plane endpoint", arrStartPoint)
'---------------------
'define distance of sections
'---------------------
divnumber= rhino.GetReal("enter equal distance of sections contour")
arrContours = Rhino.SurfaceContourPoints(strObject, arrStartPoint, arrEndPoint,divnumber)
'---------------------
'draw curve through section arraypoints
'---------------------
If IsArray(arrContours) Then
For Each arrPoints In arrContours
Rhino.Addcurve arrPoints
Next

End If
'---------------------
'select isocurves
'---------------------
arrIsoCurves=Rhino.GetObjects ("Select Section curves, from left to right or viceversa",rhObjectcurve)
ReDim arrPoints(UBound(arrIsoCurves))
'---------------------
'divide curve into equal distances and array points
'-------------------------------
DivNumber = Rhino.GetReal ("enter divide number curves")
For i=0 To UBound(arrIsoCurves)
arrPoints(i)=Rhino.DivideCurve(arrIsoCurves(i),DivNumber,True)
Next
'---------------------
'draw lines with honeycomb pattern
'-------------------------------
'>>>>>>>>>>>>>ACTIVE NEXT LINE FOR FAST CALCULATION<<<<<<<<<<<<<<<<<<

' Call rhino.EnableRedraw (False)
For i=0 To (UBound(arrIsoCurves)-1)Step 4
For j=0 To (DivNumber-2)
If j Mod 2 <> 0 Then
Rhino.addLine arrPoints(i)(j),arrPoints(i+1)(j)
Rhino.addLine arrPoints(i+1)(j),arrPoints(i+2)(j+1)
Rhino.addLine arrPoints(i+2)(j+1),arrPoints(i+1)(j+2)
Rhino.addLine arrPoints(i+2)(j+1),arrPoints(i+3)(j+1)
Rhino.addLine arrPoints(i+3)(j+1),arrPoints(i+4)(j+2)
Rhino.addLine arrPoints(i+3)(j+1),arrPoints(i+4)(j)


End If
Next
Next
'>>>>>>>>>>>>>ACTIVE NEXT LINE FOR FAST CALCULATION<<<<<<<<<<<<<<<<<<

'Call rhino.EnableRedraw (True)
End Sub

29 January 2009

Honeycomb panels 02

After last post you can found here, where i used rhino paneling tool in order to reconstruct a surface with honeycomb tesselation, now i wrote a very simple lines construction point by point in a rhinoscript found on this blog: 4ofseven, Design Studio at University of Belgrade Graduate Programme.

Option Explicit
' Author: Milutin Cerovic 2009
' www.4ofseven.com
' adapted: www.madeincalifornia.blogspot.com

Call Main()
Sub Main()
'declare variables
'-------------------------------

Dim arrIsoCurves
Dim arrPoints
Dim DivNumber
Dim i,j

'select isocurves
'-------------------------------
arrIsoCurves=Rhino.GetObjects ("Select Isocurves, in order one by one")
ReDim arrPoints(UBound(arrIsoCurves))
'divide curve into equal distances and array points

'-------------------------------
DivNumber = Rhino.GetReal ("enter divide number
")
For i=0 To UBound(arrIsoCurves)
arrPoints(i)=Rhino.DivideCurve(arrIsoCurves(i),DivNumber,True)

Next
'draw lines with honeycomb pattern
'-------------------------------

For i=0 To (UBound(arrIsoCurves)-1)Step 4
For j=0 To (DivNumber-2)
If j Mod 2 <> 0 Then
Rhino.addLine arrPoints(i)(j),arrPoints(i+1)(j)
Rhino.addLine arrPoints(i+1)(j),arrPoints(i+2)(j+1)

Rhino.addLine arrPoints(i+2)(j+1),arrPoints(i+1)(j+2)
Rhino.addLine arrPoints(i+2)(j+1),arrPoints(i+3)(j+1)
Rhino.addLine arrPoints(i+3)(j+1),arrPoints(i+4)(j+2)
Rhino.addLine arrPoints(i+3)(j+1),arrPoints(i+4)(j)


End If
Next
Next
End Sub

Diagrid bookshelf 01

Working on rhino grasshoper file using boolean difference in order to create shelves that follow the diagrid tesselation on a surface. In another test i worked on aperture of diagrid cells through a point attractor that control the scale of internal cells.