Surface and Edge Detection for Primitive Fitting of Point Clouds