Apparatus for machining an object