3
$\begingroup$

I have a Curve object that I would like to instance objects on and have them move in a specific way. The points are initially distributed evenly across the curve length then compressed to a smaller portion of the line. I would then like to iteratively displace some points (index greater than iteration) to their original position

Iteration 0: points displaced at a factor of curve factor Initial curve, points displaced at a factor of curve factor

Halfway through Iterations: Half of the points have been 'decompressed' the other half are still compressed Half of the points have been 'decompressed' the other half are still compressed

Final Iteration: Points evenly distributed along curve length Final Iteration, Points evenly distributed along curve length

If the curve has 10 segments, It would first displace the last 9 segments to the position at the spline factor +.1 . I Tried using a repeat zone setting the position of Points with an index greater than the iteration to the original curve factor but It does not displace correctly along the curve. Repeat zone Implementation

If you have any ideas on how to do something Like this or any follow up questions please let me know

Many thanks in advance for any assistance, support or helpful ideas!

$\endgroup$

2 Answers 2

4
$\begingroup$

When you want the instances to smoothly move into their positions you can do this by distributing them evenly along the curve by dividing the Spline Factor by the amount of instances (minus 1) and multiplying with the Index, then compressing the distribution by scaling down the factor by some value how much you want them to be compressed.

So this is the basic distribution - 20 cones over the complete length of the curve from factor 0 to 1:

basic distribution

And now I compress them by multiplying the basic distribution by some value which seems a suitable compression for the cones, here it is 0.2, so the cones are now stacked together and just filling the curve from factor 0 to 0.2 (I have made a group from the basic distribution to keep it cleaner):

compressed distribution

The next thing to do is not increasing the compression multiplier to 1 to get the back to the basic distribution. If you do that, all cones will simultaneously increase their distance between them and this is not what you want.

Instead you have to add to the compressed value. By adding a value the instances move forward but keep their compressed distance to each other as you can see below:

add to factor

Now comes the trick: to not make them stay compressed together but stop at the position they are supposed to be after expanding them, you have to compare the (factor) value of their current position to their basic position and switch between them once they have reached it.

To achieve this I add another Sample Curve node which will be used to get the final position from the "basic distribution" group. Then a Compare to check if the current compressed/expanded factor is greater than the final value. Then two Switch nodes to switch between the two Position and Tangent outputs:

switch between factors

You can now animate the Add value from 0 = fully compressed to 1 = fully expanded (where 1 is more than enough, actually 1 - compression multiplier would be sufficient but 1 works no matter which compression) to get the effect you want:

animated expansion

Just a quick tip at the end: I used the Transform Geometry node after the Cone to move it half its size upwards on Z, because the mesh primitive has its origin at the bottom and so aligning it with the curve tangent is better with the cone centered on its instance location.

$\endgroup$
4
$\begingroup$

Use the accumulate field, index switch and sample curve node, see below:

curve compress curve compress2

For the smooth transition you need to add another index switch "equal to current index" and use its fraction as factor for the mix node. The mix node is mixing the packed and unpacked size. curve smooth compress curve smooth compress2

$\endgroup$
3
  • $\begingroup$ Thank you so much for this! The accumulate field Node makes a lot more sense in iterating over the rest of the geometry. I was wondering if there was a way to smoothly interpolate the positions over the iterations, like the instances would move over the length of the iteration instead of 'popping out' over the iteration. I tried using a mix node to drive factor in the accumulate field instead of the switch but It compressed the whole object. $\endgroup$ Commented Nov 10 at 18:18
  • $\begingroup$ you can test with something like here: i.imgur.com/ASSBMsB.gif $\endgroup$ Commented Nov 10 at 19:57
  • $\begingroup$ @OrButbul When you are looking for smoothly interpolating positions, what's wrong with my answer? $\endgroup$ Commented Nov 12 at 19:26

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.