The invention relates to a coordinate measuring device comprising an optical sensor, and a corresponding method. The coordinate measuring device (10) has a rotatably drivable receptacle (13, 14) for agear component (11) to be measured, a measuring assembly (17) and a plurality of axes (X1, Y1, Z1, A1), which are adapted to feed movements and measuring movements of the measuring assembly (17) relative to the gear component (11), wherein the measuring assembly comprises: an optical switching sensor (20) which operates in a non-contact mode and is designed as a focus trigger sensor, wherein thefocus trigger sensor is arranged on the measuring assembly so that it is able to emit a light beam (LS) along an optical axis in the direction of the gear component (11), the focus trigger sensor is executable relative to the scanning movements of the gear component (11) through using one or more axis focus trigger sensors of the axes (X1, Y1, Z1, A1), and when the gear component (11) reaches thenominal distance (NA) relative to the focus trigger sensor, it is always provided with a switching signal (s2) provided by the focus trigger sensor.