Exclude the first and last lines of a list from addition?

I’m pulling curve/line lengths from closed curves, writing a script to lay out a pattern for bending aluminum around CNC’d plywood forms, I need to add a little tolerance at the bending points but not the ends, where it meets perfectly and gets welded.

I can’t just ignore lines 0 and 6 every-time because I have many different shapes with different breaks. I need to somehow only add to the center items, in this example, 1-5.

Does anyone have any pointers?

Cull Index with index 0 and -1.

1 Like

Or maybe you want to replace those tolerances with zero? Better to keep GH trees/lists in sync.

replace_1st_last.gh (9.9 KB)

Or more like your example (post code next time), replace 1st and last with original values before tolerance was added:

replace_1st_last2.gh (12.7 KB)

1 Like

That was perfect thanks. I realized I needed to give the ends half the tolerance to still get full tolerance on all the bends. Was able to slip that in easily.