Creating an envelope that adapts to an existing geometry

Some of the examples in this thread might be useful: