all of the code you have given us is pretty meaningless to your objective and perhaps you should concentrate your thoughts on draw_triangle/diamond as that is where the actual task is.
extend those shapes into a grid, then decide which cells are '*' and which are 'SPACE' .
you know how many rows you need, and each row adds 2 *'s to it. so you can work out the overall width.
armed with that, you can draw each row of stars "centred" in the row.
take the 3 rows example. we know the block is 5 stars wide max (1+2+2), and also know that the first row only has 1 star, and therefore 4 spaces (5-1=4), so 2 spaces 1 star 2 spaces.