fix normal calculation for shapes other than rectangular