Regular ASCII Polygons
Ruby, 139 138 bytes



-&gt;s,n{w=(((s=s.chars*' ').size/n=n.hex)**0.5).to_i+k=1&amp;~n
(0..h=w+n/5*~-w).map{|i|s.slice!(0,[w+n/6*~-w,w**k+i,w+h+~i].min*2).center w*4}}


Try it online!

A function taking 2 arguments: a string s and a shape n as a single character in hexadecimal of value 1,2,6 or A. It returns an array of strings.

Explanation

The input string is converted to an array, then joined back into a string with spaces between the characters. The length of this combined string is twice the length of the original string, minus 1. This is divided by a constant, square rooted and rounded to determine the side length w of the polygon to be drawn. The value of the constant is per the table below. For triangles, the square root is rounded down. For others, it needs to be rounded up, so we round down then add k=1&amp;~n to correct.

 Shape   Triangle  Square  Hexagon  Octagon
 n =     1         2       6        10


We iterate through h rows of output. For the triangle and square, h=w.  For the other shapes we need to add w-1 for the hexagon and twice this amount for the octagon. This is done by adding n/5*~-w.

Each line of output is centred and padded to w*4 characters which is enough for all cases. Chunks of s are removed using slice! and outputted. For the octagon the number of symbols to be outputted on each line is the minimum of three numbers: w+w-1 for the centre section, w+i for the top section and w+h-i-1 = w+h+~i for the bottom section. These formulas also work for the hexagon. Note that the numbers have to be multiplied by 2 to account for the spaces.

For the square and triangle, the width of the output is restricted to w. Therefore the formula for the centre section becomes w+n/6*~-w to cover all shapes . For the triangle, the width of the output is further restricted to 1+i. Therefore the formula for the top section becomes w**k+i to cover all shapes.