KLayout / klayout

KLayout Main Sources
http://www.klayout.org
GNU General Public License v3.0
804 stars 205 forks source link

DRC: Extent marks layout as dirty/modified #1924

Open akrinke opened 3 days ago

akrinke commented 3 days ago

Calling extent marks the layout as modified, although nothing should have changed.

Steps to reproduce: Load layout and run the following DRC script.

Checked with version 0.29.7.

active_layout = RBA::CellView::active.layout
active_cellname = RBA::CellView::active.cell_name
source(active_layout, active_cellname)
a = extent()
klayoutmatthias commented 1 day ago

Ah, well ...

Actually, "extent" creates a temporary layer. That layer is deleted at the end of the script, but it will render the layout modified.

The reasoning is that with a cell filter, the generated layer will be made from the bounding boxes of the cells, where these are stored directly inside the cell. This enables interoperability with all the other features, like clipping, cell filtering etc.

For a plain top-level box (simple "extent") that would not be required. Still it is implemented in the same way - for example to properly support clipping.

If you need a plain bounding box and don't use clipping for example, you can use that substitute which does not set the modified flag:

def readonly_extent
  DRC::DRCLayer::new(self, RBA::Region::new(source.cell_obj.bbox))
end

Matthias

akrinke commented 2 hours ago

Thanks for the explanation and the alternative! Since I'm only interested in the bounding box, it should work for me.

It was just unexpected that a DRC command apparently changes the layout.

Andreas