The application of geometrical probability to particulate systems. Part I. The critical porosity of sheared granular materials