# Lineal surface division with set lengths and gaps

Garden Bed Layout for Forum.gh (19.0 KB)

Hi all,

I’ve been trying to work on this problem for a couple of days now and can’t quite crack it. My attempt so far (attached) is a bit clunky and not optimal.

Basically, imagine a long strip 2.5 x (example)380m in which a distribution of garden beds would sit. The beds themselves would be the same 2.5m wide, but their length would be a random pick from a list of set values, and likewise between all garden beds would have a gap distance between them randomly picked from a set of possible values.

In a way I have achieved this with Anemone, and I have a panel telling me what % of the total strip is filled with garden beds… BUT

What I really want/need however, is to define in advance the percentage cover.
E.g. "I want this strip to be 30% or 50% or 75% ‘green’ (or some other figure, as needed). It still requires the ability to work with set lengths for the gardens and gaps.

The answer certainly doesn’t have to include Anemone, that was just the way I was able to think through the problem. I’m positive there is a far better, more elegant solution to be had.

I’m at a loss… Help?!

Many thanks,
Luke

There are many ways to use these numbers - random intervals from two different lists of possible values that are weaved together. The longest and shortest edges of the “Full Strip” rectangle are used in different ways; the short one is moved (repeatedly) to make the divisions and values greater than the length of the long one are ignored (using Cull).

GardenBedLayout_2018Apr9a.gh (18.9 KB)

I’d call that a pretty elegant solution - I totally missed ‘weaving’ in my thinking. Thanks for the great start. Will get me thinking on more.

Any thoughts on forcing a particular percentage into the equation?
E.g. 50% of the space becomes garden?

Does 50% include the gaps or ignore them? Version ‘b’ using rectangles:

GardenBedLayout_2018Apr9b.gh (20.0 KB)

Cheers for that - Percentage coverage wants to be without the gaps, essentially just the amount of gardens as compared to the whole length.

By culling alternate rectangles, we can ignore the gaps and count only the gardens (yellow rectabgles). With the ‘Number’ slider “maxed out”, the two ‘Seed’ sliders are all you have to get different patterns and total, which appears to be between ~54% and ~67% gardens?

GardenBedLayout_2018Apr9c.gh (19.9 KB)

This is excellent thank you Joseph - Using your solution and tweaking various ‘possible’ values (plus other overall lengths for different ‘mood’ sections) I’ll be able to nail exactly what I’m after. I might even hook up Galapagos for a bit of extra fun through various seed options.

Thanks again,
Luke

Here’s another way of doing it, where you control the distribution directly using a graph mapper and then “random sample” it using sublist of Jitter.

Garden Bed Layout for Forum.gh (14.6 KB)

Interesting approach - I’ll have a play and see what I can do with it. Cheers Q.