Approximation in the space of planes-Applications to geometric modeling and reverse engineering