The Casimir Effect for Generalized Piston Geometries