u/Additional_Goal_7875

Coloring Arrayed Box Faces: Fixed vs. Random Logic

Subject: Issue with logic when assigning multiple colors to Box faces in an array

Hi everyone,

I am working on a parametric model in Grasshopper where I have an array of boxes. I am trying to achieve a specific coloring logic for each box, but currently, only one color is being applied to the entire array.

My Goal: For every single box in the array:

  1. Three specific faces must be assigned three fixed colors: Beige, Grass Green, and Light Yellow (one color per face).
  2. The remaining three faces should be assigned colors randomly selected from the same palette (Beige, Grass Green, Light Yellow).

The Problem: I am struggling with the component logic. Instead of each box having a mix of fixed and random colors, the entire array is showing only one uniform color. I suspect I might be mishandling the Data Tree or the Item Index when feeding colors into the Custom Preview or the Deconstruct Brep component.

Could anyone point out where the logic might be failing? How should I structure the list of colors to match the face indices of each box in the array?

Thanks in advance for your help!

The link is now updated with public access. You can download the .gh file here

https://drive.google.com/file/d/1CU5vppWkAGXPQ_OZNt8tGYAmGKJJ6oo8/view?usp=sharing

https://preview.redd.it/bv135b1fsn0h1.png?width=2010&format=png&auto=webp&s=65261570f79516eabe48d3c687e2a277d222c30c

https://preview.redd.it/hp1e2c1fsn0h1.png?width=1863&format=png&auto=webp&s=7bf3b82dcc59e711854b634474ea76b558322bf3

https://preview.redd.it/yb8hvb1fsn0h1.png?width=486&format=png&auto=webp&s=2e8fe74b5d6ae737c612343744a6a1d81bcb6e4d

reddit.com
u/Additional_Goal_7875 — 3 days ago