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

Internal error: ../../../src/db/db/dbPolygonTools.cc:489 _cut_polygon_internal (poly, line, right_of_line) was not true #166

Closed
lukasc-ubc opened this Issue Sep 12, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@lukasc-ubc

lukasc-ubc commented Sep 12, 2018

In KLayout 0.25.4, MacOS:

  • I created a layout in GDS

  • ran a script to do an inversion

  • Saved the GDS, and received the above error

  • Saved the file as a DXF, and that works

  • Closed and opened the DXF

  • Tried saving again as a GDS, and same error

  • I also tried to clean up the polygons by doing "Merge Shapes", and that didn't help.

wg_loss_zep2.DXF.zip

Edit: It would be nice if there was a utility that checked for strange polygon things, such as in the above layout. By doing a "Size Shape" 0.001 and -0.001, I was able to get it to save.

@klayoutmatthias

This comment has been minimized.

Owner

klayoutmatthias commented Sep 16, 2018

Hi Lukas,

This error means the polygon cut algorithm which reduces the number of points down to the maximum allowed number encountered a weired situation it cannot resolve. If you used boolean operations, these situations should not arise as the resulting polygons are merged. I'll check the test case. Thanks for providing it.

DXF works because it does not have a maximum vertex count. The same holds for OASIS and CIF.

Best regards,

Matthias

@klayoutmatthias

This comment has been minimized.

Owner

klayoutmatthias commented Sep 16, 2018

Hi Lukas,

I was able to fix the issue. The reason was actually a rounding issue: the small gaps that appear in the output are sometimes closed when the polygon cut algorithm splits the polygons due to cut-point snapping. This induces a topology change that the algorithm is not expecting. I can fix this by using a higher precision internally.

I can now save your layout even with a max vertex count of 4 which gives a funny fractured layout. But XOR-wise it's (almost, within 1 DBU) the same than the original :-)

Matthias

klayoutmatthias added a commit that referenced this issue Sep 16, 2018

klayoutmatthias added a commit that referenced this issue Sep 16, 2018

klayoutmatthias added a commit that referenced this issue Sep 26, 2018

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 9, 2018

mef
Updated cad/klayout 0.25.4 to 0.25.6
0.25.6          (2018-11-23):

* Enhancement: klayoutmatthias/klayout#199
       Added an option to export DXF polygons as LINE objects
* Bugfix: klayoutmatthias/klayout#198
       Stitching of DXF contours wasn't taking nearest neighbours
* Bugfix: klayoutmatthias/klayout#191
       MainWindow/PluginRoot classes got mixed up
       As a side effect of this fix, layout views can now
       be configured individually. This wasn't working
       consistently before.

0.25.5          (2018-10-20):

* Bugfix: klayoutmatthias/klayout#162
       GDS2 LIBNAME was not maintained on "File/Save".
* Bugfix: klayoutmatthias/klayout#166
       Internal error when writing GDS files (breaking of polygons)
* Bugfix: klayoutmatthias/klayout#172
       DEF reader did not pull vias from LEF
* Bugfix: klayoutmatthias/klayout#174
       Performance issue with many layers with width >1
* Bugfix: klayoutmatthias/klayout#176
       Painting issue with texts
* Bugfix: klayoutmatthias/klayout#185
       Hash values available as __hash__ standard method now
       for Python
* Bugfix: some potential memory corruption issues fixed
       During the efforts for making the code base compatible
       with MSVC, some potential candidates for memory corruption
       have been identified and fixed.
       These fixes are included in this release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment