VL sort along curve

looking to sort object-points along curve-points. plan is two parts:

  • find nearest curve-point for each object-point
  • (sub)sort points that share the same curvepoint

for the first part i cannot get behind the syntax of using NearestNeighbour
someone from nub-support willing to re-explain ? many thanks

q vl nearest usage.zip (39.8 KB)

Hi ggml,

i guess you are trying to do something like this:


The idea is that you’re going through each of Object Points and finds nearest Curve Point.
So, in VL you should define the inputs as Spread<Vector2>, because you want to supply whole spreads into the VL node.

Object Points spread is plugged into the Splicer of the ForEach region.

So in each iteration the NearestNeighbour gets one slice of the Object Points for one of its inputs and the whole spread of Curve Points for another pin.

Note, in your version the inputs are set to Vector2, which leads to the spreading of the VL node. Imagine: in your patch will be one VL node for Each slice of these spreads. And each of these nodes don’t know anything about the spreads, it’s working only on one slice.

I’m not sure that I’ve solved your problem, I just fixed your VL patch a bit.

Hope it helps?

Also, take a look into the VL of the BezierEditor.


q_vl_nearest_usage_am.zip (14.2 KB)

hi robotanton
if i configure an input to spread, i cannot feed values to it in vvvv
also, if there is no mention of 2d vector, how will the nearestneighbour know its not 1d ?
*reattached patch is the same as in first post

Hi ggml,

could you open my patch?
Are you on beta?

The inputs are typed to Spread <Vector2>.


P.S. I’ve fixed the first post for clarity too, discourse was not displaying the <Vector2> cos it was not styled as code.

ah yes, the beta. works now, thanks

Hi ggml,

so, it looks like that two parts of your question can be solved like this:

The patch is attached.

q_vl_nearest_usage_am_2.zip (24.0 KB)


thank you for solving this
i have made friendly patch around it
sort (bezier 2d).zip (251.0 KB)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.