Close a Brep

Hello everyone, I have a problem when trying to create a closed brep.

I’ll try to be brief: I want to create shapes that resemble stone bricks. I started with a parallelepiped and generated many points on the side faces, which I then moved randomly to create 4 lofts. Everything was fine until I joined them with a brep join, which generated a closed brep.

The problem arises when I try to generate the top and bottom surfaces. I selected the jagged edges of the 4 sides and created a surface with edge surface. However, when I join them with brep join, it leaves me with 2 open breps and 1 closed one. In the screenshot, the inputs d1 and d2 in merge are the 2 top and bottom faces, while the others are the lofts of the 4 side faces that generate the closed breps.

I’m new to modeling with Grasshopper and have tried to find a solution before posting this. Can anyone help me and tell me where I’m going wrong?

Welcome to the forum! It’s always helpful if you can share your grasshopper file.

Hello, here is the file I’m working on
Bricks.gh (56.1 KB)

I’ll try another method but I don’t know if it will work for you.
Individual surfaces can also be modified.