26 February 2010

RH points counter labels01

A very useful rhinoscript for renaming array points with gradient color. Points are created by Grasshopper and it's very interesting see that the order of points is maintened, so you can select points in every manner and the order remains the original.

------------------------------------------------------------------
Option Explicit

'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Friday, 26 February 2010 11:40:04

Call Main()
Sub Main()

Dim arrobjects,count,strobjects,arrpt
Dim strDot
arrobjects=rhino.GetObjects("select points",1)

For Each strobjects In arrobjects

arrPt = rhino.pointCoordinates(strobjects)
count=count+1

strDot=Rhino.AddTextDot ("p."& count, arrPt)
Call Rhino.ObjectColor(strDot, RGB(count/5,count/10,count+5))
Next

End Sub
------------------------------------------------------------------

24 February 2010

ZHA_installation 01

This is my first work at ZHA, a parametric installation done in summer 2009. More info asap...

photo&model UNOaUNO
SCALA 1:10 DIMENSIONI: 600x200x600mm
MATERIALI: Metacrilato

23 February 2010

RH convert annotation dots to points02

A new improvement of last code on annotation dots convertion to different kind of labels. Now you can take text as prefix from one "pilot" label, coordinates are rounded to integer approximation and labels take their name from starting annotation dots with a progressive identification number.

Here the code:

/////////////////////////////////////////////////////////////////////////
Option Explicit
'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Sunday, 21 February 2010 20:40:21

'run and call subroutine
'----------------------------------------------------------
Call convert_annotation_dot_to_points_copy_label_to_points()
Sub convert_annotation_dot_to_points_copy_label_to_points()

'declare variables
'-------------------------------------------------------
Dim arrDots,strDot,strobject,strText1
Dim arrPt, strText,i
Dim count,numdots
'get input
'-------------------------------------------------------
arrDots = Rhino.GetObjects("Select annotation dots", 0, True, True )
strobject=Rhino.GetObject("select object to prefix",0)
'number classification starts from 0
'-------------------------------------------------------
count=-1
'testing if script have to shut down or go forward
'-------------------------------------------------------
If Not IsArray(arrDots) Then Exit Sub
'iterations loop
'-------------------------------------------------------

For Each strDot In arrDots
For i=0 To numdots

strText = Rhino.TextDotText(strDot)
strText1 = Rhino.TextDotText(strobject)

arrPt = Rhino.TextDotPoint(strDot)
Rhino.AddPoints array(arrPt)
Rhino.DeleteObject strDot
count=count+1

'select first o second line for addtextDot or Addtext
'-----------------------------------------------------
Rhino.AddTextdot "pt"&count&"_"& strText1 & " "& "("&strText&")" &":"&" "& Rhino.Pt2Str (arrPt, 0) , arrPt
'Rhino.AddText "pt"& count&"_"& strText1 & " "& "("&strText&")" &":"&" "& Rhino.Pt2Str (arrPt, 0) , arrPt,0.5
Next
Next
'credits
'------------------------------------------------------
Msgbox "visit http://www.co-de-it.com for more stuff"
End Sub

/////////////////////////////////////////////////////////////////////////

Ooops, something goes wrong :)

22 February 2010

RH convert annotation dots to points

In these days at ZHA office we needed a quick and fast task to rename and manage annotation dots created previously. I wrote and custom for our purpose a series of RhinoScript from one of the codes archived on McNeel website .

1.RH convert_annotation_dot_to_points

Option Explicit
'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Sunday, 21 February 2010 20:40:21

Call convert_annotation_dot_to_points()

Sub convert_annotation_dot_to_points()

Dim arrDots, strDot
arrDots = Rhino.GetObjects("Select dots", 0, True, True )

If Not IsArray(arrDots) Then Exit Sub

Dim arrPt, strText

For Each strDot In arrDots
If Rhino.IsTextDot(strDot) Then
strText = Rhino.TextDotText(strDot)
arrPt = Rhino.TextDotPoint(strDot)
Rhino.AddPoints array(arrPt)

'Rhino.AddText strText, arrPt
Rhino.DeleteObject strDot

End If
Next
End Sub






2.
RH convert_annotation_dot_to_points_coordinates

Option Explicit
'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Sunday, 21 February 2010 20:40:21

Call convert_annotation_dot_to_points_coordinates2()
Sub
convert_annotation_dot_to_points_coordinates2()

Dim arrDots, strDot
arrDots = Rhino.GetObjects("Select dots", 0, True, True )
If Not IsArray(arrDots) Then Exit Sub

Dim arrPt, strText
For Each strDot In arrDots
If Rhino.IsTextDot(strDot) Then
strText = Rhino.TextDotText(strDot)
arrPt = Rhino.TextDotPoint(strDot)
Rhino.AddPoints array(arrPt)

Rhino.DeleteObject strDot


Rhino.AddTextDot "pt"& "_"& strText& "_"& Rhino.Pt2Str(arrPt, 3) , arrPt
'Rhino.AddText "pt"& "_"& strText& "_"& Rhino.Pt2Str(arrPt, 3) , arrPt
End If
Next
End Sub

2a.RH points_coordinate_ from_points


Option explicit
Call points_coordinate_from_points()
Sub
points_coordinate_from_points()

Dim arrObjects, strObject
arrObjects = Rhino.GetObjects("Select points", 1, True, True )
If Not IsArray(arrObjects) Then Exit Sub

Dim arrPoint, strText
For Each strObject In arrObjects

arrPoint = Rhino.PointCoordinates(strObject)

'Rhino.DeleteObject strObject
'change number after arrPoint to change rounding approximation
Rhino.AddTextDot "pt"& "_"& Rhino.Pt2Str(arrPoint, 0), arrpoint
'Rhino.AddText "pt"& "_"& "5"& Rhino.Pt2Str(arrPoint, 3) , arrpoint

Next
End Sub


3.RH convert_annotation_dot_to_points_copy_label_to_points

Option Explicit
'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Sunday, 21 February 2010 20:40:21
'Script adaptation from www.kokkugia.com

Call convert_annotation_dot_to_points_copy_label_to_points()
Sub
convert_annotation_dot_to_points_copy_label_to_points()

Dim arrDots, strDot
arrDots = Rhino.GetObjects("Select annotation dots", 0, True, True )


If Not IsArray(arrDots) Then Exit Sub

Dim arrPt, strText
For Each strDot In arrDots
If Rhino.IsTextDot(strDot) Then
strText = Rhino.TextDotText(strDot)
arrPt = Rhino.TextDotPoint(strDot)
Rhino.AddPoints array(arrPt)
'Rhino.AddText strText, arrPt
Rhino.DeleteObject strDot
End If
Next

MsgBox "First of all, remember to place your copy object at X,Y,Z Origin"

Dim obj,pts,i,pointCoord


'input -points+objec
obj=Rhino.GetObject("select object to copy")
pts=Rhino.GetObjects("select points to copy to")
'loop through all the points
For i=0 To Ubound(pts)
'get the position of the point
pointcoord=rhino.PointCoordinates(pts(i))
'copy object to tha position
Rhino.CopyObject obj,array(0,0,0),pointcoord
Next
Msgbox "visit http://www.co-de-it.com for more stuff"

End Sub

RH Surface Area values 01


This rhinoscript code returns area values from an array of surfaces into Annotation Dot and Text Labels. Sum of the area values will be the next step...tbc





Option Explicit
'Script written by Davide del Giudice
'Script copyrighted by Co-de-iT www.co-de-it.com
'Script version Sunday, 21 February 2010 20:40:21

Call returnArea()
Sub returnArea()

Dim arrObj,strObj,arrMP,arrtemp,strtext
Dim arrPt


arrObj= Rhino.GetObjects("input surfaces",8)

For Each strObj In arrObj
arrtemp=Rhino.SurfaceAreaCentroid (strObj)
arrPt=arrTemp(0)
rhino.AddPoint arrpt
arrMP=Rhino.SurfaceArea (strObj)
rhino.DuplicateEdgeCurves(strobj)
'use INT for integer rounding

Rhino.AddTextDot "Area"& "_"& int(arrMP(0))&"mq", arrpt
'Rhino.AddText "Area"& "_"& int(arrMP(0))&"mq", arrPt,2
rhino.HideObjects arrobj




Next
strtext=Rhino.Sum (array(arrMP(0)))
MsgBox "last: " & int(strtext)&"mq"

End Sub

16 February 2010

Elegant Ecotones_Co-de-iT GH workshop


Elegant Ecotones

Grasshopper workshop Level I - parametric & generative design _ Co-de-iT _ Bologna _ 15-19 marzo 2010

L'ecotono è la zona di transizione tra due o più ecosistemi, ed è la zona in cui si manifestano in modo più evidente i temi di soglia, gradiente, variazione, catastrofe, dove le condizioni di limite e transizione possono essere esplorate trasformandole in configurazioni formali e architettoniche interessanti. Il workshop mira ad indagare strategie attraverso cui si manifestano le condizioni di transizione tra ecosistemi, sia in termini spaziali (dalla scala territoriale alla scala dei componenti) che in termini di evoluzione o ciclicità temporale (condizioni critiche come i cicli notte/giorno nelle zone desertiche). Il tema dell'eleganza riguarda il modo in cui il sistema produce un campo armonicamente articolato e differenziato di fenotipi a partire dal genotipo attraverso un processo di "estetica delle forze" guidata attraverso lo strumento digitale.

Il tema sarà dipanato attraverso le giornate del workshop sviluppando aspetti teorici e tecnici dell'approccio parametrico generativo, con particolare attenzione a strategie di design basate su caratteristiche endogene (vincoli interni del sistema) ed esogene (fattori ambientali) allo scopo di stimolare l'esplorazione di soluzioni sistemiche innovative.
Il numero dei partecipanti è fissato a 16 per offrire un tutoraggio proficuo ed una effettiva esperienza di learning ad ogni iscritto.

Temi:

Teoria

. transizione
. eleganza
. efficienza
. ridondanza
. sensibilità
. ornamento
. spazio

tecnica

. dati:gestione, manipolazione, visualizzazione
. generazione di geometria da dati
. logiche parametriche applicate al design
. genotipo/fenotipi
. attrattori, drivers e tecniche di modulazione

Dettagli:

Istruttori: Giulio Piacentino - McNeel (GH intro), Alessio Erioli + Andrea Graziano - Co-de-iT (GH & design tutors).

Si richiede esperienza di base nella modellazione in Rhino.
Saranno disponibili computers con preinstallate versioni di prova del software; i partecipanti potranno, a loro discrezione, utilizzare il proprio notebook.
Quota d'iscrizione (max 16 posti) : € 400 + IVA - la quota non comprende vitto e alloggio

Luogo : Pentacom - Via Petroni 18/4, Bologna

Orario : 10.00-18.00.

Info e iscrizioni:

www.co-de-it.com

andrea@co-de-it.com

10 February 2010

Phyllotaxis System 05b///////////////////////////////////////////////////////////


Images on phyllotaxis system05 speculation.


(via Wikipedia) A nest is a place of refuge to hold an animal's eggs and/or provide a place to live or raise offspring. They are usually made of some organic material such as twigs, grass, and leaves; or may simply be a depression in the ground, or a hole in a tree, rock or building. Human-made materials, such as string, plastic, cloth, hair or paper, may be used.

Generally each species has a distinctive style of nest.
Nests can be found in many different habitats. They are built primarily by birds, but also by mammals (e.g. squirrels), fish, insects (e.g. wasps and termites) andreptiles (e.g. snakes and turtles).

The urge to prepare an area for the building of a nest is referred to as the nesting instinct and may occur in both mammals and birds.




07 February 2010

rh lattice tesselation03//////////////////////////////////////////


Images on lattice tesselation rhinoscript speculation.

Radiolarian vector deformation 02 ///////////////////////////////////////////////////////////


Radiolarian vector deformation with two attractor/repulsor points.


Code edited in September 2009 in collaboration with Alessio Erioli and Andrea Graziano (Co-de-iT).
Download code at: http://www.co-de-it.com/wordpress/code/grasshopper-code