Photomask patterns are represented using contours defined by level-set
functions. Given target pattern, contours are optimized such that defined
photomask, when used in photolithographic process, prints wafer pattern
faithful to target pattern. Optimization utilizes "merit function" for
encoding aspects of photolithographic process, preferences relating to
resulting pattern (e.g. restriction to rectilinear patterns), robustness
against process variations, as well as restrictions imposed relating to
practical and economic manufacturability of photomasks.