Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRC/Region in deep mode: issue after mixing deep and flat box-like regions in boolean AND #1955

Open
klayoutmatthias opened this issue Dec 16, 2024 · 0 comments · May be fixed by #1956
Open
Assignees
Labels
Milestone

Comments

@klayoutmatthias
Copy link
Collaborator

This code illustrates the problem

import klayout.db as kdb

ly = kdb.Layout()
top = ly.create_cell("TOP")
l1 = ly.layer(1, 0)

dss = kdb.DeepShapeStore()

rr = kdb.Region(kdb.Box(0, 0, 100, 100))

r = kdb.Region(top.begin_shapes_rec(l1), dss)
r += kdb.Region(kdb.Box(0, 0, 1000, 1000))

# this spoils the dss object, if 
# 1. the first region is a deep region
# 2. the second region is a flat region
# 3. both regions are boxes
# after this operation, bounding boxes are no
# longer updated inside the DSS.
randrr = r & rr

r += kdb.Region(kdb.Box(1000, 1000, 2000, 2000))

# bbox should be 0,0;2000,2000
# bbox is 0,0;1000,1000!
print(f"r={r} bbox={r.bbox()}")

Expected output is:

r=(0,0;0,1000;1000,1000;1000,0);(1000,1000;1000,2000;2000,2000;2000,1000) bbox=(0,0;2000,2000)

Actual output is:

r=(0,0;0,1000;1000,1000;1000,0);(1000,1000;1000,2000;2000,2000;2000,1000) bbox=(0,0;1000,1000)

This problem does not happen with version 0.29.8, but with 0.29.10.

klayoutmatthias pushed a commit that referenced this issue Dec 16, 2024
Problem was caused by a leaking PolygonIteratorDelegate that locked the
DSS layout object. Solved by wrapping in PolygonIterator and
changing the interface such that PolygonIteratorDelegegate is no
longer useful.
@klayoutmatthias klayoutmatthias self-assigned this Dec 16, 2024
@klayoutmatthias klayoutmatthias linked a pull request Dec 16, 2024 that will close this issue
@klayoutmatthias klayoutmatthias added this to the 0.29.11 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant