Method or apparatus with machining