Piece corner/edge calculation