How can I connect those parts with beam?


I succeeded in getting the borders of pixels. I could just make each border lines, but I found that it can also be diagonal when I connect its midpoints.

But I have no idea to connect these into lines.
For the performance, I’d like to connect with beams and remove unnecessary nodes.

thank you for reading this