A processing device comprising: a first portion; a first servomotor configured to drive said first portion in a first direction; a distance sensor provided to said first portion; a second portion supported by said first portion such that said second portion is movable in a second direction orthogonal to said first direction; a second servomotor configured to drive said second portion in said second direction; and a control device, wherein said second portion is configured to support a tool for processing a work (50A, 50B), said distance sensor is configured to measure a distance in said second direction to a reference surface of said work (50A, 50B) and to output a distance signal indicating said distance when said distance sensor is located at each of a plurality of positions in said first direction, said control device is configured to generate measurement data indicating relationships between coordinates in said first direction of a plurality of points on said reference surface and distances from said plurality of points to said distance sensor based on said distance signal, to determine a step coordinate range as a coordinate range in said first direction of a step formed on said reference surface based on said measurement data, to generate control data indicating a locus of said tool based on said measurement data and said step coordinate range, and to numerically control said first servomotor and said second servomotor based on said control data, said locus includes a first locus portion comprising coordinates in said first direction which are not included in said step coordinate range and a second locus portion comprising coordinates in said first direction which are included in said step coordinate range, and said control device is configured to calculate a portion of said control data, which corresponds to said first locus portion, by adding a first offset value to said measurement data and to calculate a portion of said control data, which corresponds to said second locus portion, by adding a second offset value to said measurement data, the second offset value being obtained by subtracting a correction value corresponding to the step from the first offset value. a first portion; a first servomotor configured to drive said first portion in a first direction; a distance sensor provided to said first portion; a second portion supported by said first portion such that said second portion is movable in a second direction orthogonal to said first direction; a second servomotor configured to drive said second portion in said second direction; and a control device, wherein said second portion is configured to support a tool for processing a work (50A, 50B), said distance sensor is configured to measure a distance in said second direction to a reference surface of said work (50A, 50B) and to output a distance signal indicating said distance when said distance sensor is located at each of a plurality of positions in said first direction, said control device is configured to generate measurement data indicating relationships between coordinates in said first direction of a plurality of points on said reference surface and distances from said plurality of points to said distance sensor based on said distance signal, to determine a step coordinate range as a coordinate range in said first direction of a step formed on said reference surface based on said measurement data, to generate control data indicating a locus of said tool based on said measurement data and said step coordinate range, and to numerically control said first servomotor and said second servomotor based on said control data, said locus includes a first locus portion comprising coordinates in said first direction which are not included in said step coordinate range and a second locus portion comprising coordinates in said first direction which are included in said step coordinate range, and said control device is configured to calculate a portion of said control data, which corresponds to said first locus portion, by adding a first offset value to said measurement data and to calculate a portion of said control data, which corresponds to said second locus portion, by adding a second offset value to said measurement data, the second offset value being obtained by subtracting a correction value corresponding to the step from the first offset value.