I’m trying to move points along both closed curves and open curves using
If I have a number going to the “Length” input of
evaluate length and I add to the number and create a result that’s longer than a curve’s length, I get an error. Same if I subtract and I get a result lower than zero.
For closed curves, I wanted input less that zero to wrap backwards beyond the seam, and input over the curve length to wrap forwards beyond the seam.
For open curves, I wanted input less than zero to return zero, and input over the curve length to return the curve length.
Here’s the definition I wrote to do this. Wrap Numbers.gh (45.0 KB) It almost works, but I’m wondering if, as usual, I made something overcomplicated.
Is there some domain component that will wrap numbers like I did for closed curves? or some simpler way to do this?
Is there some math or logic component that will limit numbers to a range like I did for the open curves?
My definition (I think because I’m using
combine data) , only works with a pair of matched lists as input. Is there a way rewrite this to make it work with, for instance, a single input and a list, or a list and a tree, the way standard GH component works?