@Atalha,
Good that you managed with native objects. I don’t have a lot of experience designing such surfaces. I’m not so experienced with designing such objects, but what I can say is that unless the shape of your surface is very specific, a lot of those freeform objects/surfaces can lead to the same shape but they will differ in the way they are optimized. Also, if you have some prior knowledge about how this object will get manufactured, it can be helpful to start with a specific model of the sag. Another thing, if you are going to run this optimization in non-sequential mode, it might be computationally intensive and you want to ensure that as many rays reach your detector as possible. There are some criterion in the Optimization Wizard which you can use, such as Spatial Uniformity. Spatial Uniformity will minimize the standard deviation of all pixels using a NSDD operand. Note that if light doesn’t cover your entire detector, it might causes problems as the change in intensity between the light and dark regions are features of high standard deviation. In such case, you might want to use a different metric for the optimization (and then figure out the corresponding operands to use), or in complex cases use the Bitmap Optimization as described in this article:
https://support.zemax.com/hc/en-us/articles/1500005575582-Using-the-OpticStudio-Non-Sequential-Optimization-Wizards
Alternatively, there are cases where it is possible to make such an optimization in sequential mode, which is substantially more efficient. Have a look at this beam shaper example:
https://support.zemax.com/hc/en-us/articles/1500005489161-How-to-design-a-Gaussian-to-Top-Hat-beam-shaper
Lastly, there are a number of resources regarding freeform optics in the Knowledge base, I suggest browsing a few:
https://support.zemax.com/hc/en-us/search?utf8=%E2%9C%93&query=freeform
At this point this is really a design problem that you’ll have to figure out based on your needs and the constraints of the problem.
Keep us updated of your progress and let me know if anything wasn’t clear.
Take care,
David