3d Curve Fitting