2
$\begingroup$

I want to get the cumulative height difference of a curve, preferably using geometry nodes. For example, if one curve goes from 0→100m Z in a straight line and another goes from 0→100→0→100 (i.e. twice fom 0→100), just getting the bounding box would in both cases give 100m, but the second curve has a cumulative Z increase of 200m that I would like to get.

How would I go about getting this value?

I am thinking to use resampling of the curve to, say, 1m steps and then check for positive Z changes between all the points, worrying about the curve direction later. I am still trying to wrap my head around how to operate on points and do not know where to start, but I suppose it involves comparing consecutive points somehow.

Solved: Adding to the solution provided by Chris. I think I reduced it to the bare minimum without messing anything up. It misbehaves if object origin is below the spline of the curve, but otherwise seems to work perfectly. Node setup from curve geometry to value of cumulative height 5m curve objects with different elevation profiles

$\endgroup$
2
  • $\begingroup$ did you try using accumulate field node? it adds up all the values within a group and you can take the total. $\endgroup$
    – shmuel
    Oct 10, 2023 at 0:09
  • $\begingroup$ Thank you for the help! Looks like that method was what Chris also used. $\endgroup$
    – Ruff
    Oct 10, 2023 at 19:18

1 Answer 1

2
$\begingroup$

what about this node setup?

enter image description here

of course, depending on your chosen count, your result will be more or less accurate.

result:

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you so much for writing that up! It looks like exactly what I want. What is connected to the first math/add node at the far left? I have tried to recreate the setup you show but, missing that input, I am unable to recreate the results. I will go through the node documentation and try to break down the setup so I can understand it, but if you don't mind I'd also be very happy if you could describe the setup. I assume that it is summing the difference in Z value of adjacent points, pair-wise, - but I am currently at a complete loss to understand what is what. $\endgroup$
    – Ruff
    Oct 10, 2023 at 15:49
  • $\begingroup$ oh, i am sorry, it is just the index node $\endgroup$
    – Chris
    Oct 10, 2023 at 16:31

You must log in to answer this question.

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