0
$\begingroup$

I am trying to get the following spline effect. A group of splines (maybe starts from a grid), who follow a given spline but with some random offsets to the given spline. though this offset should be zero at the start and end of the given spline. So all the siblings (smoothly converge) at the end and start at the endpoint of the given spline. their randomization is thus larger at around the center

Or in other wordings, I have a master spline, and other splines are drawn around it, in a bit chaotic way (not just their normal distance but in essence the points which they go through are randomized between the start and end of the given spline, but in such a way that begin and endpoint there they go (slowly) from 0 then it randomizes more and then to 0 again at the end of the given spline.

To me it's for learning cause I don't know how to get it right. Once I create instances, I don't seem to be able to randomize smoother spline's points close around the given spline, I don't have access to it (or I just don't understand that part of instances), even with a "realize" node it just won't work, and as seen in the image (not what I want I can fix an endpoint (but it seems just in the middle, and it's not smooth at all.

Ideally, it is possible to set a smooth transition using a 'vector curves node'.

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

Snap randomized copies to initial curve

Here is how I would approach it :

  • Generate copies of the guiding curve with randomized positions
  • Increase curve sampling if needed
  • Change start and end positions to match the guiding curve

Copies of guiding curve

Let's say your guiding curve is globally following the x-axis. You can easily spawn copies of the curve with a circle. I've displayed the circle on which I've spawned the curves just to help you understand visually :

Spawn copies with randomized position

There are tons of ways to randomize the position. My solution is especially suited if your guiding curve roughly travels along a line (here x-axis). Then it's only a matter of aligning the circle with that axis.

Snap ends of curves to guiding curve

At this point, each curve as the same number of control points as your initial guiding curve. If it's a bezier curve with 2 control points, then you would only be moving these control points. In our case, we can simply resample the curve (you could input the resolution of the guiding curve).

We now have a lot of control points, which we can Set Position. With the help of a Mix node, we can smoothly transition between the randomized position and the initial position.

Snap ends of curves to guiding curve

Here I'm using a Color Ramp to encode which part of the curve we want to snap to the initial curve. Alternatively, you could use a Float Curve node.

  • Note that you can use other interpolation modes for your Color Ramp. The default linear probably won't suit your case, as it will create angles in your curves.
  • The Sample Curve here works as follows : for any Factor of our current randomized curve, we get the position of the guiding curve at the same Factor.

Final setup

Final node setup

My solution is especially bad if you want to retain the original number of control points.

$\endgroup$
1
  • $\begingroup$ That looks great, probaply the solution of what i want (i'd like it to be a bit more chaotic in the midle but i gues if the spline gets longer that will happen. i think though you solved the main issue i had with getting inside each instance of the various splines, by the looks. I'll test it next week. thanks ! $\endgroup$
    – Peter
    Commented Mar 7 at 15:20

You must log in to answer this question.

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