Merging Polygons with Holes introduces cut lines that are offgrid

I have multiple hexagon rings that I want to merge.

The problem is cutlines appear at seemingly random locations and are always offgrid. This leads to a lot of DRC errors
Is there a way to force the cutlines to stay in the grid when merging?

Thanks!

Comments

  • Are you merging for some reason?

    Making it all into a single polygon with a huge vertex
    count seems like inviting mishap. Especially when
    working at non-45-integer-multiple, rounding error
    (and lacking a finishing snap-to) might be the source
    of DRC errors.

    I think I'd make the hex a cell that's all on-grid, nothing
    funny, and just step them.

  • Hi dick_freebird,

    Thanks for the response. What do you mean by "step them"?

    I used KLayout's python api to force the vertices of the polygons to grid. Merging them in Klayout creates cuts that are offgrid. The cuts start at an ON-Grid vertex but ends in an OFF-grid point at the diagonal edge of the hexagon.
    I tried merging in Cadence and it's the same thing.
    I have narrowed down the drc errors to the vertices of the automatically created cuts created by Klayout and Cadence. Right now, a fix is to snap them to grid in the import stream options of Cadence. But I was wondering if there is a solution to this using Klayout's python api or using the GUI.

  • Hi @icplau,

    A small DRC script that snaps the layer to a given grid is this:

    # Example: snap layer 100/0 to 0.01.um
    l = input(100, 0)
    l = l.raw.snap(0.01.um)
    l.output(100, 0)
    

    The "raw" option will preserve the cutline, so the cut point is snapped.

    A remark about cut lines and grid snapping: many tools do not consider grids when introducing cut lines (apart from DBU), because a cut line should disturb the original polygon as little as possible. On the other hand, GDS does not support polygons with holes, hence there is no way to work around them.

    As @dick_freebird mentioned, not merging is an option. Not only for preventing issues with the cut lines, but also to avoid huge polygons. Usually it is not strictly necessary to merge your layouts. Mask makers will understand how to read them without merging.

    Matthias

Sign In or Register to comment.