Third-party end user reports that unite_polygons_on_layer appears to be slow for large polygon counts. The use case for this customer is uniting all polygons on every layer to produce a fully-merged set of polygons, so they are not using e.g. the selection by net name, etc.
Steps for implementing the feature
Remove calculation of a dictionary of net name to list of polygon objects regardless of whether the caller specifies a set of nets or not.
Rather than the current "unite the outlines, then add the voids" algorithm, I think we could loop over the original polygons and:
a. Convert each polygon to a PolygonData.
b. Loop over the voids in the polygon, convert each to PolygonData, and call AddHoles on the primary outline PolygonData with the void data.
c. After the main loop completes, unite all the resulting PolygonData and then create new polygon objects and voids based on the returned data (e.g. each main list PolygonData becomes a polygon and that PolygonData's holes become voids in that polygon). This avoids the O(n*m) time checking intersection of every void with every polygon in the output stage.
Description of the feature
Third-party end user reports that unite_polygons_on_layer appears to be slow for large polygon counts. The use case for this customer is uniting all polygons on every layer to produce a fully-merged set of polygons, so they are not using e.g. the selection by net name, etc.
Steps for implementing the feature
Useful links and references
No response