In the linked question, we are just interested in the upper half of the circle and not at all the base (diameter). So, that is why we are just using the perimeter as $\pi*r$.
Every formula is used in certain context. And understanding context is more important than the formula.
ADDED- Perimeter can be considered as the length of a tape required to cover the given figure. So, now i guess you can see which formula is to be used.