If you have a planar quad mesh and extrude the sides of each quad along the normal to its face, then these extruded beams will not match up between adjacent faces, because the face normals are different.
Instead you need a single normal per vertex.
You can then take the end points of each edge, and move them along their respective vertex normals to get the 4 points of each beam segment. However, in general this will result in the beams being twisted, even though the mesh is made of planar quads. It is only when the mesh and its vertex normals meet specific conditions that a torsion free beam layout is possible (i.e. the beams are all planar and intersect cleanly in a single line at each node). You can optimise a mesh to have this property though, and I shared an example of this here: