It works as intended.
For the front side, the back side and the connection, one material each can be selected.
The code still needs to be optimized. When it is done, I will post it as a resource and attach a link here.
UPDATE
link => Round-edged box flat