CAM parts detection and copy based on three-coordinate measuring machine