Polygon with cylindrical edges
I think the easiest way to do this is to bevel a curve object.
Go to Blender Preferences &gt; Add-ons. Type &quot;extra&quot; in the search bar, and activate the Add Curve: Extra Objects add-on by checking the box next to it.

Then in the 3D Viewport press Shift + a, choose Curve &gt; Polygon and set the sides to 6.
In the Properties window, go to Object Data Properties &gt; Bevel, and change the Depth value to give the curve thickness.

Then move and rotate the vertexes in Edit Mode to get the desired result.

If you want the corners to be less sharp and more rounded you can change the handle type of the selected vertices (from the original Vector) to Aligned. You can also use Vector and Aligned vertices together in one curve to get a more precise result.

EDIT:
Alternatively (which I quite stupidly didn't realize before) you can place Spheres to represent the atoms at the corners of the curve. If you would use a Hook modifier the curve would follow the position of the atom object.
Select the curve. Go into Edit Mode. Select a corner Vertex. Press Ctrl + S and choose Cursor to Selected. Go to object mode and Press Shift + A and choose a spherical object like Mesh &gt; UV Sphere. (Press S to scale it down)
Now select the the sphere and Shift select the curve (in that order) so both are selected. Go into Edit model and select the curve vertex and press Ctrl + H and choose Hook to Selected object.

However if you choose to do this, you might want to parent the curve and all its atoms to an empty object, to be able to move the molecule (by moving the empty) without issues. (Add an empty, move it in the center of your molecule, select al the parts of the molecule, Shift select the empty, press Ctrl + P and choose Object(keep Transform). )