Optimized surface discretization of functionally defined