RhinoScript

Page 53

ETSAM - DELEGACION ALUMNOS DISEÑO PARAMÉTRICO Y ALGORITMICO - INTRODUCCION

ADOLFO NADAL SERRANO MAS. ARCHITECT - ARCHI [O] LOGICS - ARCHIOLOGICS.COM

[Fig 6. Script aplicado a mallas de distinta densidad sobre el mismo terreno - la resolución de la definición es sensiblemente mejor en la malla de la izquierda]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

[ 53 ]

Option Explicit ‘Script written by Adolfo Nadal ‘Script by archi[o]logics www.archiologics.com Call Main() Sub Main() Dim strmesh : strmesh = Rhino.GetObject (“Select your terrain mesh”,32) ‘nrVC = number of vertices Dim nrVC : nrVC = Rhino.MeshVertexCount(strmesh)-1 ‘arrV = vertices ‘arrVN = vertex normals Dim arrV,arrVN arrVN = Rhino.MeshVertexNormals (strMesh) arrV = Rhino.MeshVertices(strMesh) ‘arrVNP = vertex normals projected (z = z of mesh vertex) Dim arrVNP ReDim arrVNP(nrVC) ‘arrVC = nr times vertices Color has changed for each vertex Dim arrVC() ReDim arrVC(nrVC) Dim arrVCRGB() ReDim arrVCRGB(nrVC) Dim i For i = 0 To Ubound (arrVCRGB) arrVCRGB(i) = Array(0,0,0) Next Dim arrFV : arrFV = Rhino.MeshFaceVertices(strMesh) ‘face vertices contains the index of the vertices contained in arrV Dim j, k For j = 0 To Ubound (arrFV) For k = 0 To Ubound (arrFV(j)) Dim arrVNtmp, arrVNPtmp,arrVtmp arrVtmp = arrV(arrFV(j)(k))


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.