I’ve created a good function to merge shading surfaces generated by LB shading designer. It consist in a smart loop, I have done a couple of examples, here you can see what happens with 143 vectors, 290 vectors… The result of the present function is red and the one of my function is yellow…
This function could be useful when you connect multiple hours and multiple months:
The only limit should be the memory of a machine, but this depends by the case to solve, if it is complicated or not.
Hi Antonello, Nice work! What do you think is the next step? Should we integrate it into the component itself so in case the old method failed to join the curves the component will try your solution as an alternative?
Yes, I think it is a good idea. I attached a file where you can see the function. It is not perfect yet, but I think its method is very interesting. I think Rhino 5 has some issues with boolean union functions, because sometimes it doesn’t work with some lists of curves or surfaces, but if you try to change the order of elements and then repeating the function, it works.
And this is basically what my function does. However, sometimes it is very slow or it could go to an infinite loop when the solution is almost impossible. For this reason I wrote a limit condition inside the loop.
If you want and you are interested in it, you could work on this method.
As i understand the SHDDesigner doesn’t deal with nonplanar surfaces. The definition says “An optional shade surface representing a 2D area …”. So i assume you are asking about how it works with such planes? So, just tested and it works fine while the original component didn’t.
I am working on an option for nonplanar surfaces and will continue working with Antonello (right?) to get it ready. I suppose we will update the forum at some point if we get things working.
I tested your file, I think the problem in this special cases should be the method of the component, if I understand well, the component projects each shading surfaces using the relative vector onto the optional surface. Then it joins them together, I haven’t read the code of the component but I have imaged something like that.
Hi Mostapha
Is it right, Mostapha?
I have thought another method and maybe it should be easier, obviously we have to see if it true for all cases. These are some images of the result of this alternative method.
P.S. Abraham
Probably, I found an alternative method of the component of pergola shading. I’ll let you know.
This is awesome! I always had a sense that this method could be improved. Send a pull request with the new component when you get the chance. Even if it’s written in rhinoscript instead of rhinocommon, a slower component that never fails seems better than a fast component that fails and we can always try to change the rhinoscript over to rhinocommon later. Also, I can re-write that incorrect description once you send the pull request.