1
$\begingroup$

I'm trying to do some fields calculation to avoid creating a "limited" sequential loop but I'm facing a little problem. Pretty sure this can be done but I've yet to find the solution. Here is The problem: I have 3 different types of splines join together using a join geometry node (as test samples). What I need is to get the next point positions for every point on a particular spline. For each point I've calculated the length of the spline is on. The index of the spline the the point is on. The point index per spline, and the next point index per spline. all I need now is to get the position vector of the point that matches the spline index and the next spline point (matching to columns to get the value from a third one) but I can't seem to find a solution.

enter image description here

Any Suggestions ?

P.S I'm aware that storing the attributes in the spreadsheet may not be necessary but until I find the solution it helps me visualize the fields context

EDIT

Thank you Chris, thank you quellenform,

Chris, I'm not sure it's what I need or paraphs it is, in some weird combination. In you're setup all the points are being treated as a unit sequentially which is exactly what I'm trying to avoid by calculating all those attributes.

here is a better screenshot in witch I've tried to illustrate the problem I'm having:

enter image description here

As you can see in the spreadsheet, I need to transfer the position attributes from one row to another. The transfer should be done based on the next point of a "specific spline" and not all the points of all the splines. Each spline is Marked by a colored rectangle and is identifiable using the spline Index column, what I need is to match the "SplineNextPointIndex" with "SplinePointIndex" which are unique only within the context of "spline Index" and get the corresponding position.

I hope its clearer now, any help is welcomed:)

$\endgroup$
1
  • $\begingroup$ I've edited the original post with a new screenshot and a new explanations, is it clearer? $\endgroup$
    – MrW
    Commented Jul 28, 2022 at 13:17

2 Answers 2

1
$\begingroup$

As I understand it, you want to wrap the index per spline so that the first point gets the index of the last point.

You can solve this as follows:

enter image description here

You would only have to use the math node Wrap, and use the number of points per spline as the maximum value. This is advantageous, because you can even change Index Offset easily (if you want to change the direction, or skip several points).

As value for Wrap you use the spline index plus/minus the value for the offset.

With this you have found out the correct index.

But in order to get a certain other value from the group of splines, you would have to consider the number of points per spline, as you have already guessed correctly.

The node Accumulate Field helps you to find out these incrementing values, which you then add with the index.

Finally you only need the node Field at Index (or Transfer Attribute, depending on what exactly you want to do).

$\endgroup$
4
  • $\begingroup$ Yes this is what I've done (In "Calculate the next point based on point count" Frame) I've used modulo but it looks like we are getting the same result. I'm Stock On the next stage where I need to get the position of the "wrapped" index. $\endgroup$
    – MrW
    Commented Jul 28, 2022 at 14:00
  • $\begingroup$ I've Calculated the "spline index column" for the Wrapped indexes to be unique so i can get the position field but can seem to find a way to use it in my calculations. I'm toying with the idea of creating a 2d vector out of the Spline Index and the Spline Point index so that i can have a unique identifier but without much success. $\endgroup$
    – MrW
    Commented Jul 28, 2022 at 14:21
  • $\begingroup$ Thats it! Now I need to study your solution carefully Thank you so much! $\endgroup$
    – MrW
    Commented Jul 28, 2022 at 15:30
  • $\begingroup$ @MrW You are welcome! $\endgroup$
    – quellenform
    Commented Jul 28, 2022 at 15:38
2
$\begingroup$

i think what you are searching for is the node "field at index".

Check out this node setup:

enter image description here

It sets the position of the cylinder to each control position of the splines.

enter image description here

$\endgroup$
3
  • $\begingroup$ Thank you Chris, Hopefully it's a part of the solution. Please look at the edit section in the original post, I've tried to make a cleaner explanation of the transfer attribute that I need. $\endgroup$
    – MrW
    Commented Jul 28, 2022 at 13:10
  • $\begingroup$ ok, then pls provide blend file, so i don't have to rebuild everything manually, then i will have a look...thx. $\endgroup$
    – Chris
    Commented Jul 28, 2022 at 13:24
  • $\begingroup$ Sure, Thank you Chris drive.google.com/file/d/1NZBM3ERQLphu1sXvbS_FKTYAavrl7Ziq/… $\endgroup$
    – MrW
    Commented Jul 28, 2022 at 14:26

You must log in to answer this question.

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