base shape is an regular hexagon ABCDEF in the XY plane, visible when drawn counter clockwise.
# we will fill in the values for GHIJKL, the second hexagon
for each vertex M in (A,B,C,D,E,F) do
O = M
O.z += L
add O to second hexagon list of vertices
done
# creation of quad sides
for i = 0 to 5 do
O = hex1.vertex[i]
P = hex1.vertex[mod(i+1,6)]
Q = hex2.vertex[i]
R = hex2.vertex[mod(i+1,6)]
add POQR to list of quads for sides
done
# drawing
draw triangle fan ABCDEF
draw side quads
draw triangle fan LKJIHG