4 units
My structure felt kind of whimsical and with my initial inspiration reminding me of a circus tent, I decided to map the image below onto the structure’s panels for Part 1.
The images below show the image mapped onto the structure (without embossing/debossing):
The next images show the structure with debossing:
Here is the breakdown of the coding for Part 1:
The inputs for this include the orientation of the image and whether there is embossing or debossing. The image can be flipped vertically, horizontally, or vertically and horizontally. To insert the image, I selected the image file, read the file, and used Image.Pixels to get the color for each panel using the U and V values from the grid I created in module three. I subtracted one from each (U and V), so the number of color pixels matched the number of panels. Then I used List.Reverse and List.Transpose to reorganize the list of colors so the image can be flipped in a variety of ways.
I used Element.OverrideColorInView to change the color of panels to the colors from the image. Then, I used Color.Brightness and Math.RemapRange to adjust all of the brightness levels so they were between 0 and 3. I used 0 as my base thickness and added the adjusted brightness values for the debossed effect and subtracted for the embossed effect. Finally, I changed the heights of the panels with Element.SetParameterByName.
I had some challenges mapping the image onto the surface and had to adjust some of my code sections from module 3. Initially, my surface was divided into three surfaces, so I had to connect all of the lines into one NurbsCurve (whereas I previously had 3 separate curves) to get only one surface. I also had issues with panels and colors not matching up but was able to fix this by using List.Flatten to get the hierarchies for the lists of colors and panels to match.
Below are images of the structure from Part 2:
Unfortunately, there were some issues I was unable to resolve in this part. As seen in the images above, I had trouble adjusting the color and opening based on the panel’s directness to the sun. Some of the panels ended up white, and when I changed the panels to ones with adjustable openings, 5 of the panels would not show up in Revit.
Here is my code for Part 2:
I used the Panels.BySurface_U_V custom node from the class example the create grid and surface and add the panels. Then, I used the Panels.ComputeSunDirectness custom node also from a class example. I created the custom node SunDirectnessToColorRange_RedBlue to take the output from the panel sun directness and create a list of panel colors based on their directness to the sun, which was applied to the panels using Element.OverrideColorInView. Finally, I adjusted the openings of the panels based on their directness to the sun by setting the frame width percentage in each direction.
Below is the code for the custom node SunDirectnessToColorRange_RedBlue that I created.