Device for contactless measurement of the shape of object