List manipulation - sum specific parts of lists

Hi,

I have a question regarding sum the coordinates of 2 lists parts.

Exercise:
The are 2 lists:
List A: Represent the start coordinates of 3 line elements
List B; Represents the offset (delta) distance from the start coordinate.

Wanted result:

Geometry 1: {0;0} - Triangle:
start point; 40.8, 0, 5.3
2nd point; 40.8, 7,8, 5.3
3rd point; 38, 7.8, 5.3

Geometry 2: {0;1} - Triangle:
start point; 40.8, 0, 11.6
2nd point; 40.8, 7.8, 11.6
3rd point; 38, 7.8, 11.6

Geometry 3: {1;0} - Rectangle:
start point; 52.8, 0, 5.3
2nd point; 53.6, 0, 5.3
3rd point; 53.6, 4.2, 5.3
3rd point; 52.8, 4.2, 5.3

However, when I try to do this, the Addition commands adds the delta distance of the rectangle already to the start point of the second triangle. Resulting in 2 Rectangles and 1 triangle.
Triangle 1 = ok
Rectange --> should be triangle --> false
Rectangle 2 = ok

any one a suggestion? it can probably be done with a list manipulation, however i cant see it at the moment.

Thank you in advance. 2020-03-28 combine lists to 2 triangles and 1 rectangle.gh (9.4 KB)

This should be general solutionâ€¦

Isnâ€™t this a duplicate exercise from another thread?

Perfect!
Thank you!

1 Like