0
$\begingroup$

So I have three splines (3 vertical lines for example) and I want to make them cylinders with different randomized profiles. enter image description here

enter image description here

This is the basic idea of what I have. I want with every repeat to spawn a cylinder of random radius on one of the splines, not on every one. (I know this can be done easily by making three separate curves, but my set-up requires a loop to generate a random profile. I pick random length segments of the curve multiple times and make a random-radius profile mesh. I just need to do it on each spline separately so they look different)

$\endgroup$
4
  • $\begingroup$ Do everything inside the loop, including the line creation. $\endgroup$ Commented Feb 18 at 18:33
  • $\begingroup$ I plan to apply quite a lot of transformations on the curve before meshing it, I would really like to avoid putting all that in a loop if possible. There has to be a way to modify splines in a curve separately. I tried doing it by id but couldn't find a set-up that works. $\endgroup$ Commented Feb 19 at 3:21
  • $\begingroup$ Similarly to what you did with the random ID, you need to have an index (which could actually be the ID) to use a "separate geometry" node (so you can take a single spline to work on). Currently you're modifying all splines at once, more than once. You may also need to realize instances since you created the splines via instancing. $\endgroup$ Commented Feb 19 at 5:38
  • $\begingroup$ Thing is I want to apply the transformation multiple times per spline, just not on all of them at the same time, so that each spline is unique. I don't want to create a new spline each time. I tried realizing the instances and separate geometry, but I can't figure out how to control the selection of Separate Geometry node so it cycles through the three splines each loop. $\endgroup$ Commented Feb 19 at 6:14

2 Answers 2

1
$\begingroup$

A suggestion to avoid loops:

Example

Nodes

You can make use of the spline index (index evaluated on spline domain) to get random values or make calculations instead of separating each in a loop.

  • Height:
    • By selecting only the end points (with the endpoint selection node), you can change only the end point positions
  • Radius:
    • Each point on a spline has a "radius" attribute, which is 1 by default
    • If you "Set Curve Radius", you can use a circle of radius 1 and it will be multiplied by the spline point radius attribute
    • Index connected to "Evaluate on Domain: spline" take the index of each spline instead of the point indices
    • With the indice of the spline as ID, you can take one random number per spline
$\endgroup$
1
  • $\begingroup$ It is cleaner this way for this example, but I use loops for the transform in my project (random arc section, thanks again for that one too). Would've been too clustered so I tried to showcase the problem with an easier example. $\endgroup$ Commented Feb 19 at 14:26
1
$\begingroup$

Ok, so I got it working. I added a Separate Geometry node before the transformation. As for the Selection, a Compare node set to equal, did the trick. As one input I used an Index node, I don't know why but it wouldn't work with the index from a Spline Parameter node. Now with each loop it applies the transform to only one spline, iterating through them for a constant number of transforms/spline. Thanks again Daniel!

Picture if needed: Geo nodes for individual looped transform on splines in curve

Be sure to set Separate Geometry to spline and realize the instances before looping.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.