Metal foam in Grasshopper

This one works, but if you increase or change the size box the mesh intersection fails.