Test curve for change in Z axis

I’m trying to detect if a curve has any variation in its Z height. I tried it with the Planar component, but I don’t get the result I expect.

The problem is that if I have just a line from 0,0,0 to 1,0,0 for example, it can be on many planes, and when I check it to see if it’s on the World XY plane, it fails because it could be on XZ as well.
Another issue is that while some lines have no variation in the Z axis, they may be above or below Z=0, so that is probably why testing against the XY world plane doesn’t work.

What I really want to find out is if the Z axis, regardless of if they are at Z=0 or not. I thought maybe there would be a way with Boundingbox with the plane set to World XY, it does seem to differentiate between things that have a height and things that do not, but I don’t know how to make the comparison to get a boolean output as to whether it has Z axis variation or not.


Test for Z change in curve.gh (9.7 KB)

This can be achieved with the dot product. The dot product of two parallel vectors is 1.

Test for Z change in curve.gh (15.1 KB)

1 Like

@martinsiegrist Thank you, that works perfectly.

I want to perform a solid difference only on the items that have a Z difference, I thought I could use a stream gate to do this, but I get this error, I don’t quite understand it, but it seems I’m not trying to use it correctly.

what’s the correct way to only process items that are false after this test?

In this case you need to use sift

1 Like

@martinsiegrist that works great! thank you. I would have never figured that out.

1 Like