Recreate Room boundary

I’m trying to recreate the room boundary with less segment to get the length for each side at the end

Instead of 2 segments along the same direction turn it into one line by removing the intersection point between them

If all of the points are in order, you can “walk” the boundary curve, evaluating 3 points at a time. If an X or Y coordinate is shared between all 3 points, discard the current point. Take a square, for example, with 5 points:

Pt A: (0, 0)
Pt B: (1, 0)
Pt C: (1, 1)
Pt D: (0.5, 1)
Pt E: (0, 1)

You can see that points C, D, and E all have the same Y coordinate, meaning that your final list should only have points A, B, C, and E.

This is probably more easily done in Python, but not impossible to do in Dynamo with OOTB nodes.

I have done it before by getting the normal for each curve , and if the curves intersect if 2 curves have the same normal and they both intersect get once end and start point then remove it , after use polycurve by points.

But i haven’t used dynamo for a while and I’m unable to recreate it again

I made it work but unfortunately it work out with some rooms and with others not the issue withing when to sat true or false.

Hope anyone can help as I have 283 rooms

Re-Create Room Solution.dyn (116.2 KB)

Any suggestions