Orienting array of panels works for 1 surface but fails on multiple

I’m trying to create an array of surfaces across a diverse variety of plane geometry. I’ve built a script that that reliably creates an array of panels on any sort of quadrilateral. However, when I try to apply this to multiple surfaces, the script produces strange results, beginning at an orient command about halfway through the script. This seems to be something with the data from multiple trees misaligning, because I can gain some sort of improvement by flattening some of the incoming data; however, it still doesn’t quite work.

This is one surface, applying panels effectively:

This is a second surface, again effective:

This is both surfaces at once, a mess:

I’ve included the entire script as I think it’s helpful in understanding the final intent, however the problem begins halfway through, at an orient module:

Thanks in advance for any light folks can shed on my fogginess. PS, the script uses the plugin ‘Pufferfish’

230307_parametric-panels.gh (19.2 KB)

You have two surfaces so you need to provide all inputs on the orient component in two branches.

I don’t use Pufferfish so I don’t know what you are trying to to towards the end of the definition.

230307_parametric-panels.gh (28.4 KB)

missing

Yeah, it’s data trees for sure. I would start by grafting the two surfaces, then eliminate most of the Orient components because collectively, they are redundant.

Looks like Martin got it?

1 Like

Thanks for the help @martinsiegrist! I think I understand what the Shift Paths module is doing, and the output is making a lot more sense. Apologies for the Pufferfish, I imagine there’s a way I could avoid the plugin, but it’s working for the moment.

Thanks @Joseph_Oster for the tip on the overuse of Orients–I’m going to try to make the script more efficient once I have a reliable output.

This is very hasty as I still have groceries to unpack… I skipped some details, sorry, but I think you’ll see what I mean by redundant code.


parametric-panels_2023Mar7a.gh (19.3 KB)

I see now that I could have rotated the planes before creating the rectangles.

Thanks @Joseph_Oster, this is great, I will use this to optimize at the end!

One thing I’m also trying is to orient each of this sets of small planes such that they remain planar to their host planes, but their y-orientation aligns with the world’s y-orientation. It’s also important that these smaller planes stay in rows, as shown in the picture; this is why I rotated and cull by surface boundary right at the end, rather than earlier as shown in your solution @martinsiegrist

230307_parametric-panels_2.gh (24.9 KB)

Here are some small improvements:

  1. Use Untrim instead of PxS.
  2. Center the rectangles on their frames by constructing domains using “-x/2” and “x/2”.
  3. Separate rotation angle controls for each surface, though they both look good at -45 degrees.


parametric-panels_2023Mar7b.gh (22.9 KB)

Reading your last post now… not sure I get it, let me think about what you are asking.

Thanks again Joseph!!

It was a dumb question…one of the ones you have to ask to suddenly see the solution. Just for posterity…
image

I’m not so sure it makes sense to align any planes with Y, given their arbitrary orientation. The planes I am using are the “natural” result of EvalSrf on the untrimmed surfaces. Looks good to me?

@Joseph_Oster I would agree in general, though in this case these are photovoltaics, and I want them all to be facing ‘south’. I’m now struggling with a secondary issue that depending on how you build the surface the y normal can be 180 opposite

Oh. :thinking: That’s a whole different issue, eh… Maybe eliminate the rotation and just align planes before creating the rectangles? And use sliders for spacing values to get the panels as close together as possible? I added the expression “floor(x)” to the ‘U’ and ‘V’ inputs of SDivide, though the difference is probably insignificant.


parametric-panels_2023Mar7c.gh (22.9 KB) - DEPRECATED

UPDATE: (twice) Cull planes before creating rectangles, remove “floor(x)” expressions.


parametric-panels_2023Mar7dd.gh (21.1 KB)

Awesome, I will definitely be able to incorporate some of this efficiencies. However, part of the reasoning for making the the rectangles, rotating as a group, and then culling is so that the panels remain in neat rows. I’ve been trying this on a number of geometries to ensure it’s a robust and broadly-applicable script.

I’m still having a bit of trouble with the orientation of the panels, which I think only becomes evident when they are tilted using the Pufferfish ‘Rotate Plane XYZ’ module. But I am hoping to sort it out.

Thanks again for all the help Joseph
230307_parametric-panels_3.gh (36.6 KB)

Why do you need Pufferfish to rotate a plane?

I see nothing when I open your file. I can dig around but it’s too much work, especially with two models in the same file. Slowly revealing more requirements is also called “moving the goal posts”.

Parallel to one edge of the roof? Bottom edge? Top edge? How does this work on roof surfaces that face north? Have fun.

haha yes, you’ve got me, this goal is nowhere near the first one. Thanks for the help Joseph