Grasshopper

algorithmic modeling for Rhino

Hi guys,

I am using this script to apply a hexagonal pattern onto a surface:
http://www.livearchitecture.net/archives/3299

Would anyone know what defines the direction of the pattern and how to rotate it 90degrees ?
I would like the pointy part to be on the left and right edge instead of on the top.
Hope that makes sense.

Many thanks,

Arthur

Views: 371

Replies to This Discussion

Hi Arthur,

Go inside the component and replace the loops with this:


For i As Int32 = 0 To u - 3 Step 4

For j As Int32 = 0 To v - 3 Step 2

ptArr.Append(arrPt(i + 1, j).x, arrPt(i + 1, j).y, arrPt(i + 1, j).z)
ptArr.Append(arrPt(i + 2, j).x, arrPt(i + 2, j).y, arrPt(i + 2, j).z)
ptArr.Append(arrPt(i + 3, j + 1).x, arrPt(i + 3, j + 1).y, arrPt(i + 3, j + 1).z)
ptArr.Append(arrPt(i + 2, j + 2).x, arrPt(i + 2, j + 2).y, arrPt(i + 2, j + 2).z)
ptArr.Append(arrPt(i + 1, j + 2).x, arrPt(i + 1, j + 2).y, arrPt(i + 1, j + 2).z)
ptArr.Append(arrPt(i, j + 1).x, arrPt(i, j + 1).y, arrPt(i, j + 1).z)
ptArr.Append(arrPt(i + 1, j).x, arrPt(i + 1, j).y, arrPt(i + 1, j).z)

Dim pline As New OnPolyline(ptArr)


lines.Add(pline)

Dim pt As New On3dPoint((arrPt(i, j).x + arrPt(i + 3, j + 2).x) / 2, (arrPt(i, j).y + arrPt(i + 3, j + 2).y) / 2, (arrPt(i, j).z + arrPt(i + 3, j + 2).z) / 2)
pt_list.Add(pt)

ptArr.destroy

Next

Next

For i As Int32 = 2 To u - 3 Step 4

For j As Int32 = 1 To v - 3 Step 2

ptArr.Append(arrPt(i + 1, j).x, arrPt(i + 1, j).y, arrPt(i + 1, j).z)
ptArr.Append(arrPt(i + 2, j).x, arrPt(i + 2, j).y, arrPt(i + 2, j).z)
ptArr.Append(arrPt(i + 3, j + 1).x, arrPt(i + 3, j + 1).y, arrPt(i + 3, j + 1).z)
ptArr.Append(arrPt(i + 2, j + 2).x, arrPt(i + 2, j + 2).y, arrPt(i + 2, j + 2).z)
ptArr.Append(arrPt(i + 1, j + 2).x, arrPt(i + 1, j + 2).y, arrPt(i + 1, j + 2).z)
ptArr.Append(arrPt(i, j + 1).x, arrPt(i, j + 1).y, arrPt(i, j + 1).z)
ptArr.Append(arrPt(i + 1, j).x, arrPt(i + 1, j).y, arrPt(i + 1, j).z)

Dim pline As New OnPolyline(ptArr)

lines.Add(pline)

Dim pt As New On3dPoint((arrPt(i, j).x + arrPt(i + 3, j + 2).x) / 2, (arrPt(i, j).y + arrPt(i + 3, j + 2).y) / 2, (arrPt(i, j).z + arrPt(i + 3, j + 2).z) / 2)
pt_list.Add(pt)

ptArr.destroy

Next

Next
Forgot about the explanation :)


black - original, yellow - modified
Amazing Jacek ! Thanks a lot.
Would you know how to make a switch that would go from one configuration to the other ?
To make a switch try something like this:

1. add one more input to the VB component, name it "blnRotate", type hint: boolean
2. connect a boolean toggle to this new input
3. inside the component add an "If" clause following this logic:
If blnRotate then
code from my previous post
Else
corresponding part of the original code
End If

Haven't tested this, but it should do the trick.
I was going to do just this, but my windows side suddenly decided to not want to work...it should be an easy fix as you say...

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service