Closed lukasc-ubc closed 6 years ago
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
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
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.