Machining a ball valve