DRC False Flags on Bent Paths - path-to-polygon bug?

Hi Matthias,

I'm scratching my head over a strange false flag scenario.

I've boiled it down to a very simple shape - a path with 3 points. How I arrived at these points is somewhat convoluted but it is part of a much larger structure that has been giving me trouble with false DRC flags. Here is the shape:

And here are the vertices:

-8763.84300 -11243.48400
-8763.72400 -11243.60500
-8763.60500 -11243.72400

I've attached the simple GDS (with both path and polygon interpretations) and DRC script in the zip file. I'm getting two errors flagged:

1. The leftmost corner is likely being flagged as an acute angle. This sort of makes sense to me if you chalk it up to machine precision. I know you can also filter out angles if needed. Let me know if I'm wrong in that assumption though.
2. The middle of the top right edge is being flagged. This is where I believe the path-to-polygon bug comes into play.

I'll just focus on the second point. When I 'merge shapes' on the path object, I get this jagged tooth where it is flagged.

It makes sense to me why this is flagged, but a) I don't know why this tooth is present in the merged shape, and more confusingly b) why does the error appear to be on a scale larger than the database unit of 1nm (1nm in y but 2nm in x) - similar to the error in (1), I'd expect a rounding error to be at most off by the database grid.

Curious to hear your thoughts on this. I haven't yet looked too far under the hood, but happy to be pointed in the right direction!

Thanks,
Adam

Comments

  • Hi @14darcia,

    thanks for this nicely prepared test case.

    The problem occurs due to the computation of the vertex:

    The center segments are parallel-shifted by half the width and the intersection point is computed to render the outline vertex q.

    I assume that the end points of the shifted segments - a and b - are rounded to database units already, hence the intersection q may not exist and the edges are simply connected.

    I have created a ticket on GitHub for this case: https://github.com/KLayout/klayout/issues/2002

    Kind regards,

    Matthias

  • Paths act funny in big-$ tools too. I much prefer 45'd and 90 hand drawn on-grid rectangles for my work. They stretch predictably and overlap clean.

    Of course this is not digital mainstream, never was.

    Paths can be drawn with properties that aggravate. 45s can have center and edge end coords all on grid or make that impossible, pick one. If you go routing anyAngle then forget sanity.
  • Thanks @Matthias for the illustration! I'll keep an eye on that ticket.

  • Hi @14darcia

    I think I have fixed your problem and will release the patch in the next major release 0.30.

    Matthias

  • Thanks @Matthias ! It seems to be resolved with 0.30.0.

Sign In or Register to comment.