I have a grid sag surface that was generated using sag values at a bunch of x, y points. I want to fit a more parameterized freeform surface (e.g. biconic zernike, Chebyshev polynomial, or polynomial) to this grid sag surface. I’ve tried to create a dummy surface after the grid sag surface and set parameters of the dummy surface to be variable. Then I used merit functions such as NORD or PLEN to try and minimize the distance or path length between the two surfaces. This sort of works, but the results of the fit aren’t very good and there’s usually some residual tilt that it seems like Zemax can’t find the right parameters for.
I have tried this process with spherical or biconic surfaces, and it works very well for those. It seems like anything that is off-axis or tilted really throws off the optimization. Any tips or other approaches that I should consider?