Help needed_Hoopsnake

GH_help needed.gh (93.4 KB)
Hi, Everyone:

I have this modules that have two sides with different length, and i wonder when i have multiple of them, for example i moved & copied or arrayed multiple of them, is it possible to auto orient them base on the sides length?

Ideally it should be alligned, but i realize it takes series of transform and the modules’ transformation is based on the transformation of the previous module, which i realize which Hoopsnake might be a solution, but i have never ever used it. I wonder if there’s anyone who is experience can give me hand ?

I don’t know what you are doing but strongly suspect you don’t need a loop?

If you really need a loop, use Anemone instead of Hoopsnake.

as Joseph already mentioned, if you don’t have any unknown variable, then a Loop is not necessary: it looks like you already have the starting position of the first item, and also have all the Transformation data available, the only thing is that each transformation has to be applied to the previous state

if you were dealing with just Vectors, you could just plug all of those into a Mass Addition and use the Partial Data output… that would give you the position of each of your items, step by step

but because Mass Addition won’t work with Transform data, you can simulate that with something like this:

Partial Sums.gh (15.9 KB)

the above is just a trivial example to show the underlying logic, but I guess you could apply that to your definition

Hi, Joseph:

I’m trying to orient each module base on the updated previous module and wanna repeat this action until i’m running out of the modules

What do you mean by “module base”? Your intent is not clear to me.
And it sounds like data trees are not clear to you.

i’m sorry for the unclear explaination, i meant, the second module need to orient base one the first module, and the third module need to orient base on the updated second module…[module here refers to the brep i’m using]

This is Recursive Geometry. The Pufferfish plugin has a component that can do this, but you have to be able to express the difference between source and target orientations as a series of regular transformations.

If the transformation changes at each iteration I don’t see a simple way without a genuine loop.