# Generating a proportional grid on a surface

Hello all, I am hoping someone would be able to help with this.
I got the definition to work the way I’d like it to but I am sure there are much better ways to achieve the same thing.
I am aiming for a surface grid subdivision where the proportions of the cells are roughly maintained. Hence as a surface becomes wider the spacing between the cells increases accordingly, in both directions.
The method I have been using is as follows
-Surface lofted between two lines, of different length and not parallel

• the shorter line is divided in a number of subdivisions of choice
-the length of a segment of the base line is evaluated and reproduced on the adjacent edge of the surface, and then on the other edge proportionally to the length ratio between the adjacent edges. A line between the two points gives the next grid subdivision (this way the cells are quasi square)
-and so on and so forth.
Attached definition shows how I have achieved this by copying over and over the same definition. How can I achieve this more efficiently? Hoopsnake perhaps? I have no idea how that works, please help!
Best
Gio160714_ProportionalGridGeneration.gh (55.3 KB)

use `Divide Surface` (SDivide)

(that said… maybe i’m not quite understanding how you’re wanting to divide up the surface… if SDivide isn’t doing it properly, what do you need differently?)

If I use sdivide, the U’s and V’s will be equally spaced at the edges, while I am trying to achieve an incremental ratio: as the length of a V span increases so should their spacing in the opposite direction, proportionally. This would reduce the grid distortion at the extremities. Does this make sense?
Maybe there’s a way of analyzing a surface that inherently returns a similar attribute?

Best

sort of… i guess i don’t understand the why of it all… or, i’m not sure if you’re looking for an exact division of some sorts or if it’s a looser “the divisions grow from small to large from one end of the curve to the other”

this probably isn’t what you’re after but there might be something you can use from this to make it do what you want it to:

idontknow.gh (9.8 KB)

Hi Jeff, thank you for this.

The reason may not be too apparent in this specific case but it becomes quite relevant in other instances. For example in the case of a sphere a uniform subdivision in U and V will make the cells near the poles "long and narrow’. With a diagrid applied to the same, very narrow angles at the poles. If you were using CHS to build a dome that way those connections would not appear too hot. An incremental ratio maintains approximately the proportions of the cells by decreasing their size towards the poles, meaning your connections will also always be similar. I hope this clarifies the purpose a bit more, its also an aesthetic preference.

Best

ok… i see. thanks for the explanation.

you’ll probably want to experiment with the expression in the .gh above… the x^y thing… it will allow you to create a sequence that increases in an exponential fashion.