1. A method of model-based metrology, the method comprising: receiving geometry of structure to be measured on surface of substrate; producing a tessellation of the geometry of the structure; using the tessellation to determine a vertical discretization and a horizontal discretization so as to generate a discrete model for the geometry, wherein the tessellation comprises a polygonal structure which approximates the geometry, and a curve is tessellated by replacing the curve with a polygonal line; and performing scatterometry computations using the discrete model to measure of one or more features of the structure on the surface of the substrate and storing results of said measurement, wherein a face is tessellated with triangular tiles.