Title: Least-squares surface fitting with discontinuous functions