2
$\begingroup$

I understand this node setup here with points:

enter image description here

result:

enter image description here

so i get each point offsetted by 0.01 from the accumulate field.

if i now change point to edge, i get this, which i don't understand:

enter image description here

maybe some GN pro can enlighten me...

$\endgroup$
3
  • $\begingroup$ Let me put it in your words: "pls provide blend file" ;-) (No, please don't, just kidding!) $\endgroup$
    – quellenform
    Dec 19, 2022 at 19:12
  • 2
    $\begingroup$ I would say it is related to the fact that Accumulate Field creates the values in the Edge domain, but are queried by Set Position in the Point domain, and therefore are interpolated. Why do you set this to "Edge" at all, if you want to influence the positions of the points? What exactly is the goal? $\endgroup$
    – quellenform
    Dec 19, 2022 at 19:22
  • $\begingroup$ no goal - just trying to understand things ;) - that makes sense! Thank you! $\endgroup$
    – Chris
    Dec 19, 2022 at 19:35

1 Answer 1

4
$\begingroup$

Quellenform is, of course, right: Accumulate Field node is noting down the values for edges, but Set Position is evaluating them in the Point domain, so there is an interpolation going on. Since vertices can be connected to more than one edge, they acquire more values the more connected they are. Here's a setup with edge and vertex indices exposed so we can check how that interpolation is executed exactly:

enter image description here

Big black numbers are the edge indices, small red numbers are vertex indices. Spreadsheet on the left is showing the final Z values, and the spreadsheet on the right is showing the values accumulating on the edge domain (connected to a Viewer). I'm using the Trailing socket so edge indices and the accumulating values are directly correlated: Index 0 gets a value of $0.00$, Index 6 gets $0.06$ and so on...

Contrasting the numbers for a while makes the method obvious: every vertex gets a final value of all their neighbor edge values combined, divided by the number of total connections. Let's take a look at a random vertex; say, vertex Index 12 in the middle. It has $4$ edges connected to it, with values (again, in this instance, correlated with their index numbers) $10, 30, 9,$ and $29$. Add them all up: $78$. Divide that by the number of connections: $78/4=19.5$ We look at the left spreadsheet and see that indeed, vertex Index 12 has a Z value of $0.195$.

So the seemingly random fluctuations of points in your example is simply the result of how indices are distributed when geometry is first created: on the left and top edges of the grid, edges with very low and very high indices happen to be neighbors so you get those "jump"s.

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ thank you very much for that great explanation! $\endgroup$
    – Chris
    Dec 19, 2022 at 20:26
  • 1
    $\begingroup$ You're welcome, Chris! "Because edges to points interpolation" was kinda obvious but I didn't know how it was exactly calculated. I'm glad you asked so I was forced to find out. I wonder if there are any cool tricks that take advantage of domain interpolations like this. $\endgroup$
    – Kuboå
    Dec 19, 2022 at 20:43
  • 1
    $\begingroup$ Beautifully explained! $\endgroup$
    – quellenform
    Dec 20, 2022 at 1:05

You must log in to answer this question.

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