Order Reconstruction for Nematics on Squares and Hexagons: A Landau--de Gennes Study