I am trying a script that can slice any surface and create a printable solid from it. I will be adding holes to each Item of the this data tree.How do you get the solids such that they share a wall rather than intersecting each other. Or is this too much to ask without a solver of some kind?

Thanks for that, but I have come to realize that I need the returns(walls) to be planar for the fabrication simplicity. I would really appreciate help towards the same.
thanks.