A strange problem with OASIS format

edited June 2012 in KLayout Support
Hi Matthias,

We encountered a strange problem and have no idea what happened, could you please help to figure out the root cause? Thanks~

First we open a OASIS file(from.oas) and didn't get any warning/error message, then save as a new file(to.oas) directly without warning message too.
However once we try to open the new file(to.oas), klayout terminal shows the following warning messages:
Warning: Type 0 or 1 point list with odd number of points is illegal (position=10678097, cell=ic2)
Warning: Type 0 or 1 point list with odd number of points is illegal (position=10731885, cell=ic2)
Warning: Type 0 or 1 point list with odd number of points is illegal (position=10732482, cell=ic2)
Warning: Type 0 or 1 point list with odd number of points is illegal (position=78614198, cell=ic2)
Warning: Type 0 or 1 point list with odd number of points is illegal (position=78688413, cell=ic2)
Warning: Type 0 or 1 point list with odd number of points is illegal (position=78693024, cell=ic2)
etc....

Then we tried to read the new file(to.oas) with Mentor Calibre, it gives us an error message:
ERROR: Invalid delta count 391 for type 1 POLYGON point list in input file to.oas at file offset 32268754.

Best Regards,
--
chhung

Comments

  • edited June 2012

    Hi chhung,

    I actually was able to reproduce the problem but it happens only under very special circumstances (self-intersecting, manhattan polygons with repeated points). Such polygons are detected as well-formed manhattan polygons although they are not. The problem seems also not to appear at compression levels larger than 0.

    I think the file can be repaired by reading and writing it again. As a workaround in your script you could use a compression level of larger that 0 which is a good idea anyway.

    However, to be sure, here is a patch for dbOASISWriter.cc, line 1769 and following which should avoid that problem:

    ...
    //  test last displacement for polygons
    if (for_polygons && type >= 0) {
      //  BEGIN PATCH
      if (hvlast != type) {
        type = -1;
      } else if (plast.x () == 0) {
      //  END PATCH
        if (hvlast != 0) {
          type = -1;
        }
      } else if (plast.y () == 0) {
        if (hvlast != 1) {
          type = -1;
        }
      } else {
        type = -1;
      }
    }
    ...
    

    Maybe you have a chance to test that patch. If it solved the problem, I could include it into the next 0.21 release.

    Best regards,

    Matthias

  • edited June 2012
    Hi Matthias,

    Thanks for the patch, I applied it on 0.21.17 and it fixed the Invalid Delta Count issue, thank you so much~ :)

    However we have another problem now, could you please download the test case file from the website?

    It's a test file that could be used to show our problem.

    The steps:
    1. Open the testcase.oas and Save As new file name with Scaling factor 0.7 and Database unit 0.001
    2. If the output format is GDSII, the pattern is correct besides off grid(Precision issue)
    3. If the output format is OASIS, the pattern would be incorrect and out of our prediction.

    Once we repeat the procedure with Database unit 0.0001, the result is correct even the output format is OASIS, I have no idea what happened.

    Really appreciate your kindly help~ Thank you...

    Best Regards,
    --
    chhung
  • edited November -1

    Hi chhung,

    thanks for the feedback, I'll include the patch in the source.

    Regarding the test case: I fail to download it - the connection will time out. Is it possible to send the testcase by mail?

    I have tried to find a problem with scaled output and so far I have not found an apparent bug. Given your description I can imagine that some small distance snaps down to zero which might cause problems. But I would need your testcase to pinpoint the cause.

    Thanks and best regards,

    Matthias

  • edited November -1
    Hi Matthias,

    I've sent a mail to contact @ klayout . de (with correct mail format), thank you so much~ :)

    If still failed to get the email, please let me know~

    Best Regards,
    --
    chhung
  • edited November -1

    Hi chhung,

    0.21.19 should fix that problem.

    Thanks and best regards,

    Matthias

  • edited November -1
    Hi Matthias,

    I have tried to download then make 0.21.19 smoothly, and it fixed the problems we feedback before, really thanks for your kindly mail notice. :)

    Best Regards,
    --
    chhung
Sign In or Register to comment.