Geometry Nodes Resample curve Non Linear

Hello community, I would like to ask a question. I want to do a resample curve to a curve but without the equidistant points. the length input of the resample curve node is supposed to be a field input but it doesn’t work for me. Is it possible to do a resampling with gradual distances? Thank you so much

Are you talking about the Sample Curve node or the Resample Curve node? Sample curve is about getting information not changing it.

Sample Curve Node — Blender Manual

Resample Curve Node — Blender Manual

Resample curve

There is no length input on resample curve. The count input is for number of points along the curve you can adjust them after you create them but they are initially created equidistant.

There si option Count, Length and Evaluated

Resample curve length mode.

length mode

Based on the incoming total spline length points will be added at length increment from spline start position to spline end position. (vert count = Spline length/resample length)

To perform an incremental or logarithmic scale between points:

  • You must 1st create the points you desire which will be evenly spaced (regardless of resample mode)
  • capture an attribute index or factor or position of each point
  • apply whatever math you want
  • apply the offset with the set position node

the instance on points stuff was just for visibility. Is this what you were looking for?

1 Like

Thanks for replying, I’ve tried it and it’s not what I need. It makes the curve longer, I need it to do the same thing as the resample curve, which adapts to the curve I have but with different distances between the points. Thanks again for responding.


I need you to do the red circles. I do not understand why it does not accept the input that appears in the spreadsheet, it only takes the first input and repeats it throughout the curve. I understand that if you have a field input it should accept all data. I expected it to work like the Set Curve Radius node.

The input as a field appears to be used only to find the maximum length between any 2 points on the curve and not as a general field input.

They are utilizing a multi-thread approach likely for speed but this prevents evaluation of each segment based on the previous.

The set curve radius instead iterates through each point by index.

Previous versions of the node show the length input as a single input instead of a field:

ref https://developer.blender.org/T89250

This may have been changed to better accommodate the evaluation of Bezier curve lengths.

You can always report the lack of sequential evaluation as a bug https://www.youtube.com/watch?v=JTD0OJq_rF4

However given the description of the operation as:

Most curves are only 1 spline with multiple points instead of multiple splines. The response will likely be that the operation is working as intended even if the input to the node seems confusing.

3 Likes

Thank you very much for the explanation. Awesome

A possible solution.



Thanks for all.

1 Like

The index is evaluated against the mesh line (not the spiral it is sampling from) to calculate the curve factor, so you can simplify like in this example:


…the divide node is what is normalizing the calculation (keeping it in the range -1 to 1), so doing a power afterwards will also be in that range and the curve length will be preserved:
image

i.e. Resample doesn’t come into play, you’re constructing a new curve form a mesh-line with the count of “samples” you want. Doesn’t work so well with multi-curve setups.

Good luck.

5 Likes

I’m dealing with a similar issue, and also realized I was having no luck with resampling a curve with uneven spacing. I’m fairly novice at geometry nodes but I followed a tutorial to move a single object along a curve factor. Instead of a single object I got this working on multiple instances through some trial and error, with different spacing for each instance index. The setup here probably needs work but the float curve is driving the instance spacing, which makes for some nice hands-on control. The map range can adjust the stop and start position of your instances. As a bonus the scale of the instances is also connected to the curve.
GeoNodesPlantSpacing.blend (204.8 KB)


1 Like

Hello,

I’m looking into doing exactly that : using a power function to move point toward one side of the curve.
But with several splines within one object… I was wondering if anyone managed to solve this problem yet ! After a few hours I still can’t find a way, I’ll try again tomorrow :smiley:

So,
I find a way to make it work, it probably needs a polishing pass but it can be a good starting point :

Tweaking the green nodes will give this kind of distribution :

By accumulating each splines’s length we can recreate an “absolute” length factor, so each point is distributed along all the splines ( using the sample curve set to length) .

The two map ranges converts back and forth the points position in the 0-1 range per spline.
We can then use the power function in-between ( or a float curve) .

Finally because there are some little rounding errors, it’s best to make sure the start / end points of each splines keep their original locations.

I tried first to make a version using Factor mode rather than Length, it worked but with more rounding issues leading some points to jump from one spline to another.

Hopes that helps !

6 Likes

Hey, sorry, I was asleep while you were solving this…

I think you have the best solution - any attempt at using the factor or indices has the problem that the Sample Curve acts across all curves so pairs of end-points will occupy the same factor values… so, it is effectively impossible to get unique factors for the end-points.

And, as you’ve mentioned - there seems to be a lot of error between attempting a normalized spline factor and the overall spline factor:


…showing here how the sampled factors don’t line up with the original points. :man_shrugging:

Good work!

1 Like

Here is a slight simplification to your method:


… the circled bit is equivalent to adding the trailing length to the length and normalizing it - you can just use the factor.

Cheers!

5 Likes

Super cool !!

Indeed , now it looks so obvious :smiley: I guess my brain was running out of energy :smiley:
I like how simple it looks once the solution is there but it was so tricky to find !

Thanks @zeroskilz !

2 Likes

Hey, really glad I found that one.
Tho I think I have another question to add to this topic, is it possible to make the points from the resample non linear depending the the radius of the curve?

Having more points when the curves radius is smaller and less points when the curves radius is bigger. To preserve somewhat equal rectangle topology on X - Y instead of being squish. (or maybe there is a better way?)

3 Likes

I guess I’ll bump this, because I’m looking for exactly the same thing as @guppy0z.

3 Likes