Regular patchwork algorithm is also fine. Code in other languages also welcome.

Similar questions and discussions