Added function for calculating number of elements in a polygonal shell.