Uneven Scaling within Boundary Constraints

Hi everyone,

I’m working on a Grasshopper scene where I have a grid of rectangles that generate slightly rotated surfaces (rotated along two axes). I’m trying to achieve the following:

  1. Align the top of each surface to the same height (a mean height value). > easy
  2. Scale each surface based on its distance to this highest height value, creating a transformation that reflects this relationship. > ok, simple
  3. Maintain the outer boundary of the original grid so that the transformations respect these constraints. > mwah…

The end result I’m aiming for is an uneven subdivision of the grid, where the scaling of the surfaces introduces visual variation while keeping them aligned at the top.

I initially thought a weighted Voronoi approach might work, but it didn’t give the desired results. I’m a bit stuck on how to approach this problem effectively. I guess it’s somewhat related to this post to divide a surface given a list of areas. How to divide uneven surface (plot) by area - Grasshopper - McNeel Forum, byt in my case an evolutionary solver is not desired as my final geometry has over 200.000 surfaces, so looking for a more straightforward solution that doesn;t have to be perfects.

When I started this, I presumed that the increasing height ratios in X and Y axis would offer me a direction and i could deduce the asthmatically logic from there (the quick graph display show there is a logic), and from that make iso

I’ve attached the Grasshopper script along with a reference image showing the current state (top view) and a rough sketch (top view) of what I imagine the outcome should look like.

Any ideas, suggestions, or workflows to help tackle this would be greatly appreciated!

Thanks in advance!

uneven_scale.gh (73.3 KB)



While giving it some extra thought (as always the ‘aha- moment’ after posting ;)) It’s kinda related to TreeMap visualisations and to got me to this python script (Treemap - Grasshopper) which seems promising, although it seems hard to control the output (or my lack of skills therefor)

some progress i think … i’ve attempted to create a treemap where in this representation the colors represent the deviation from the highest point. This deviation is converted into an area ratio, which is then used to divide a boundary rectangle into smaller rectangles proportional to these ratios. While progress was made, the spatial order of the rectangles in the treemap does not appear to align with the input data grid (on the right of this image), but the respective ratio’s are very close.

Any fresh perspective or a clean pair of eyes on this would be much appreciated!
lens_uneven_scale_02.gh (79.0 KB)