CNC tool path optimization