1. A method, comprising: providing a layout pattern; generating a contour that represents the layout pattern after the layout pattern has been subjected to a manufacturing process; generating a polygon that approximates a geometry of the contour; extracting an electrical parameter from the polygon; and building a pattern library using the polygon and the electrical parameter.