heitzmann/gdstk

KLayout doesn't like the OASIS output for this, but the GDSII file seems to be accepted.

philstopford opened this issue · 2 comments

def test():
    lib = gdstk.Library("Library")
    cell = lib.new_cell("Base")
    pol = gdstk.rectangle((0, 0), (1, 1))
    pol.repetition = gdstk.Repetition(x_offsets=(1, 3, -2))
    cell.add(pol)
    lib.write_gds("rectangle_rep.gds")
    lib.write_oas("rectangle_rep.oas")

test()

KLayout reports a coordinate value overflow (position=51, cell=#0) for the OASIS file.

Similarly, this yields a file that KLayout rejects

def testf():
    lib = gdstk.Library("Library")
    cell = lib.new_cell("Base")
    pol = gdstk.Polygon(((0, 0), (0, 1), (0.2, 1), (0.2, 0.8), (0.1, 0.8), (0.1, 0.6), (0.2, 0.6), (0.2, 0.4), (0.1, 0.4), (0.1, 0)))
    pol.repetition = gdstk.Repetition(x_offsets=(1, 3, -2))
    cell.add(pol)
    lib.write_gds("f_rep.gds")
    lib.write_oas("f_rep.oas")

testf()

Any repetition object with negative offset will create an invalid OASIS. Thanks for reporting, I'm aware of the cause of this bug. Whenever I have some time, I can work on it.