These days I've been giving a Dynamo workshop to Jan, a former Grasshopper user with a big passion for optimization problems and automation.
He showed me a couple of examples were GH is used to solve panels optimization, in particular something that would produce flat panels over an organic surface.
I liked the challenge and we started to discuss possible algorithms to find a Dynamo solution to the same problem.
Firstly the subdivision of the surface only using Dynamo Out Of The Box nodes as opposed to the possibility of using LunchBox (I'd say just for academic purposes), so to have set of points to place adaptive components.
In Revit is relatively easy to get flat adaptive components out of 4 points and
Zach Krone showed how to do that in his blog, what you have in return though is a set of panels that are discontinuous, in other words you have gaps along the sides of the panels and usually when I show this example I use a report parameter to measure how much the panels are deviating from the original surface.
The optimization problem is different, basically you accept to have points that are not sitting on the original surface but that are derived from it and that put together will generate a set of flat panels with no gaps, so that the outcome will look like a continuous quad mesh.
I started to think at this problem having in mind the iterative approach that I've seen in the videos that Jan showed me, I came up with a couple of different solutions, each vertex can be further adjusted at each iteration based on a variable number of "target" optimized positions (from 0 to 4) depending on where it is in the grid. If you set an high enough number of iterations you eventually get what you are looking for, but I guess that the optimization should be also after the minimum number of iterations required to get all the panels to be flat.
In the first attempt I've used an iterative approach that took in consideration all the vertices at each cycle, so it was running on a new set of points at each iteration.
In the second attempt I decided to introduce a maximum deviation from the flat condition for groups of 4 points. Basically if 4 points satisfy the maximum deviation condition they are not going to change in the following iterations.
In the image above, on the left you see an output for 5000 iterations over a 9x9 grid generated from the free form surface in Revit on the right.
The grey panels are flat, the colored panels didn't meet the maximum deviation condition (in this particular case it means that the red corners for each panel are more than 0.00001 mm away from the plane that best fit the 4 corners).
In the output I have a value that tells me the number of iterations required and the time elapsed to find the optimized vertices, if the number of iterations reaches the maximum values it means that not all the panels meet the maximum deviation condition.
This kind of processes can bring down the fabrication costs quite sensibly, once again Dynamo saved the day.