2
$\begingroup$

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 what I want with geometry nodes

This is my attempt This is my attempt

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$ May 12, 2022 at 10:59
  • $\begingroup$ 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. $\endgroup$
    – Roel Deden
    May 12, 2022 at 11:26

2 Answers 2

3
$\begingroup$

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

enter image description here

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.

$\endgroup$
1
  • $\begingroup$ Brilliant, this solution is very elegant. More lengths can just be plugged in. I love it, thanks a lot. $\endgroup$
    – Roel Deden
    May 12, 2022 at 12:38
2
$\begingroup$

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:

enter image description here

$\endgroup$
1
  • $\begingroup$ This works really well, thanks a lot. I never would have found this solution myself. :) $\endgroup$
    – Roel Deden
    May 12, 2022 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .