Squaring the circle: An algorithm for generating polyhedral invariant sets from ellipsoidal ones