Klayout python "check_width" generate dummy triangles on tilted paths

Dear Matthias,

I am using python in Klayout. I am creating scripts to check width of polygons in my design.

I use:
l1 = pya.Region(cell.begin_shapes_rec(layer1)).merged()
l11 = l1.width_check(value * Dbu).polygons( 0 )
cell.shapes(olo).insert(l11)

If the poligons are inclined insteadt of horizontal or vertical, I get a error marker in the form of a triangle at such corner :

Is any way to mask or avoid that the corners are returned as width errors?

Thank you in advance
Best regards
Giovannni

Comments

  • edited June 2024

    Hi Giovanni,

    I assume (without being able to measure that) that the angle at this corner is a little less than 90 degree and the edges are counted as "opposite". The "ignore_angle" option (forth argument) can fix this, i.e.

     l1.width_check(value * Dbu, False, pya.Region.Euclidian, 89.0).polygons( 0 )
    

    With KLayout >=0.29.2, you can use the keyword argument:

     l1.width_check(value * Dbu, ignore_angle = 89.0).polygons( 0 )
    

    Matthias

  • Dear Matthias,

    Thank you very much for your prompt response: You are really a great person. Thank you

    Btw:
    The angle is 78 deg.

    I have used your suggestion and added "min_projection" to the code (with this I was able to remove the triangle):
    l1.width_check(value * Dbu, False, pya.Region.Euclidian, 89.0, min_projection = 22 * Dbu).polygons( 0 )

    The problem is that now only polygons longer than 22um are checked. Small polygons are totally skipped.
    Is this the right way to do it ?

    Thank you again
    Best regards
    Giovanni

  • Okay ... but the 89 was just an example. If your angle is 78 degree, you may want to use

    l1.width_check(value * Dbu, ignore_angle = 77.0).polygons( 0 )
    

    (so a little less than you minimum angle).

    "min_projection" is something else.

    Matthias

Sign In or Register to comment.