Added option to set boundary orientation.