Hex grid onto "baseball" surface as evenly as possible

Hi

I´ve been trying for half a day to get the complete cells (6 sides) of a hex grid to fit nicely on this trimmed surface. My goal is to scale and stretch the cells as evenly as possible to maintain the hexagonal shape.

The best outcomes have been either completely destroying the cells that are originally outside the target surface (the Angle restriction of Kangaroo didn´t look like doing it´s job), or then the edges of the surfaces were left empty.

I tried to give different strengths for different lines to make the transformation happen more in the center of the hex grid instead of the edges being destroyed, but didn´t manage.

It is an interesting battle between the forces of Kangaroo as there is no easy way to make it happen, if it is possible at all. Some tryouts have been almost satisfying, but I´d like to see some real wizardry from the ones who know what they are doing! :smiley:

The best result would be all needed kinds of deformations (line length and angle) spread out the most even way possible, filling as much of the target surface as possible.

Thanks!

210920Practising.gh (16.8 KB)

Your angle goal was wired up in the wrong way.
It needs as input the 2 lines you want it to control the angle between.
For a hex grid like this, this can be the angle between consecutive segments of each hexagon.
Also for the Length goal, making the 6 segments of each hexagon equal will to each other will give a better result here than trying to make all the segments across the whole grid equal.
210920Practising2.gh (19.5 KB)
I’m not sure what you want to happen around the boundary - depending on the aim you might want to select some points around the edge of your grid and pull them to the curve.

Also, for hexagons on a partial sphere, a non-iterative way with the least distortion of shape is to use a stereographic projection, as shown here

image

Thanks!

So this is where Moebius transformation steps in!

I thought any 2 curves would do as the input for angle, regardless if they happen to be touching each other. So this way I tried to maintain the original angle of every line.

Will try it now like his, and clearly the example you shared shows it to be possible.

Yes, you are right about this - the lines don’t need to be touching.
It’s just that when you take the list of all edges with duplicates removed, then select alternating items from this, which line gets matched with which isn’t very structured - you’ll have some lines trying to maintain their angle with another line right next to them, and some maintaining their angle with one way across the other side of the grid. This causes it to relax in an uneven way. Making sure instead that it’s always between one edge and the next one around the same hexagon gives a smoother result.

Ahh… Yeah I figured it would be really random the way the lines would be paired but thought that to result in an “overall” web of pairs that would result in a rather uniform force against the distortion.

Btw I played with the improved file and realised it works fine if the hex grid has similar values for U and V. Instead when trying to fit a grid with “flat” cells (about twice as wide as high) things get complicated again. Swapping Equal Length into Length helped a bit though.

Thanks!