# Geometry nodes variable mesh line

I am trying to make a mesh line with variable segments. The idea is to have 2, 3 or 4 variable edge lengths that repeat. I think im not understanding a very basic principle.

This is what I want with geometry nodes

This is my attempt

• You need to connect the "count" to a free "Group Input" socket. This way, the number of vertices will be determines by input parameter of the Geo Node Modifier. You can then add a Transform Modifier to Scale the mesh line so its size will be fixed regardless of the count. May 12, 2022 at 10:59
• What i mean to do is create a mesh line and make the first segment 1m the second segment 0.5 meter the third segment 1m the forth segment 0.5m etc. so two or three lengths that follow eachother up continuesly. May 12, 2022 at 11:26

I guess you are looking for a super flexible solution based on geometry nodes only, without having to use any inputs.

Here I simply create any number of curves (extend them as needed), join them with the node Join Geometry and then record the number of splines.

Then I create a Mesh Line with this number multiplied by an arbitrary value for repetition, transfer the length of the single splines with the node Transfer Attribute, accumulate these values with the Node Accumulate Field and reset the positions of the mesh line.

...roughly summarized.

• Brilliant, this solution is very elegant. More lengths can just be plugged in. I love it, thanks a lot. May 12, 2022 at 12:38

Accumulate field is designed for such tasks. It can add values together so that it is easy to make such sequences. All you have to do is to put first, second and third value one by one, in my example using switchers:

• This works really well, thanks a lot. I never would have found this solution myself. :) May 12, 2022 at 12:37