# Array shape along curve with no overlap and no rotation

Dear forum,

I am trying to achieve the following effect:

The endgoal is to be able to generate quick, optimizeable iterations of architectural plans like this:

(Jørn Utzon’s Kingo Houses in Denmark)

The important thing is that the arrayed geometry should not overlap with each other while still having the same rotation.

I can easily make it work with a rail curve that does not change direction and simple rectangles, but for the life of me I cannot figure out how to make the transition indicated in red. And if the arrayed geometry is anything else than a rectangle (or a circle of course), I also come up short.

I have been looking to posts such as this one, but it rotates the geometry.

Is it possible to achieve this in vanilla Grasshopper or with free plug-ins? Or do I need to be able to code a script?

A bonus could be that the input rail curve could also be a closed circle, but that is not a must.

Any help or tips appreciated!

Rune

There was a similar discussion a long time ago here: How can I move rectangles along a curve and where they overlap, the rectangles should move to where they butt up against each other?

1 Like
1 Like

Thank you so much for the reply!

Sadly the topic you linked to didn’t work out. The problem is that the approach can’t handle when the input rail curve changes direction, or indeed points in any other direction than the angle between the world x and y axis. I need to work out a definition that can handle any curve in any direction.

Hi HS_Kim,

Thanks for the links. I think your suggestion using the anemone plugin is the closest thing I have come so far, but it still needs some work in order to function correctly when the curve changes direction - I guess because it’s solving intersection events for only one edge of the input shape. See here:

I will have a further look and see if I can tweak your definition!

Here’s a little script for this

arrayAlongCurve.gh (6.4 KB)

4 Likes

@DanielPiker did it faster)
Same approach, but in python

tryPack.gh (4.2 KB)

5 Likes

Hi Daniel,

That’s fantastic, thank you so much!

I found one odd behaviour in your script - if the input curve has its direction reversed with the “Flip” command in Rhino, the script only outputs one shape. I wonder why this is?

I guess that just confirms that I will need to learn some coding!

Hi Pavlo,

So great, thanks for the definition - Daniel might have done it faster, but I’m sure I’ll have an easier time “decoding” a python script than C#. I’ll play around with it and see. Thanks again!

It tries to finds the intersections of the doubled bounding rectangle of the last shape with the path curve, then selects the next one along in the parameter space of the curve.

Line 75
`if(t > 0 && t < tdif)`
was to avoid it doing this when the path curve doubles back on itself:

I didn’t consider though the case where the domain of the curve runs from a negative number at the start to zero at the end, which you get if flipping a curve. Just turning on ‘Reparametrize’ for the input curve is one way to avoid this issue.