top of page

Coding the Heydar Aliyev Centre in Grasshopper (Part 2)

Writer's picture: lewisbond1997lewisbond1997

Updated: Jun 14, 2021

The series command allows me to create a series of numbers with the starting point being 0 representing the first item (panel edge) in my list. The V is then input as the step representing the series of edges needing to be selected (0, 4, 8, 12). The count is also set to the U, V divisions representing the number of items in each line.


Adding a second series command allows me to define the number of times I want the algorithm to repeat itself, followed by the starting item for each line. For instance, 0, 1, 2, 3 would select the first edge of each line as seen in green.


Connecting the resulting code with the item command and simplifying, allows me to change the items from being stored in one list of sixteen items to four lists of four items.







The branch command can be used to help visualise this, as seen in the image below. By changing the path to a value representing the first item of each line, we can see that it automatically selects the four items of whichever sequence the value is set to. For example, setting the value to 0 selects 0, 4, 8, 12.



Now that the curves have been successfully sequenced, we can use the join command to connect them together, resulting in four linear curves.


One issue with the code so far is that the line starting with item 0 is an outer edge where there are no grooves. The obvious solution to this would be hard coding. Meaning I can specify the first item of each list on the item command used previously. However, as discussed before I want the code outputs to be driven by variable parameters.


Using the cull command and setting the integer to 0 allows me to remove the first sequence whilst maintaining those variable parameters.


Now that the vertical curves have been sequenced, we must essentially repeat the process for the horizontals.


Initially I thought this process would be simple as I should just be able to copy and paste the code, while switching the item inputs from V (vertical) to U (Horizontal). However, this was for some reason not working. After diagnosing the problem, I realised that I had already done the hard part by using the series command to sequence the linear curves by a step of 4. However, for the horizontal curves this was not necessary as the items needing to be joined were already in the correct list order. For example, 0, 1, 2, 3, 4 rather than 0, 4, 8, 12. Removing this sequencing code and adding a partition command allowed me to create 4 lists of 5 consecutive items being 0, 1, 2, 3, 4 and 5, 6, 7, 8, 9 etc. The cull command can then be used again to remove the first sequence as it was an outer edge.


Image of all code so far

Comentarios


Post: Blog2 Post

The Maker Space

©2020 by The Maker Space.

  • Instagram
  • Facebook
bottom of page