Issue with database unit

edited March 2020 in KLayout Support

I am creating a layout where I would like to draw objects with a precision of 0.1 nm. To do this, I have set the database unit to 0.0001 microns = 0.1 nm. However, when I try to draw polygons (or any other object), the vertices always snap to points that are 0.001 microns = 1 nm apart. Also, the dots in the background grid never get any closer than 1 nm, no matter how far I zoom in.

Does anyone have any ideas about what I'm doing wrong? I'm fairly new to KLayout, so it could be something basic.


  • Maybe your drawing grid is still 1nm?

    Look it up in View/Grid. Or disable snapping at all using Edit/Editor Options and set "Snapping" to "No grid".


  • Thanks, the grid was set to 1nm.

    I've changed the grid to 0.1 nm now, and polygons work fine. However, when I create an instance of a library cell (e.g. a circle), the edges of the shape aren't smooth, as if it still has a resolution of 1 nm. Is there a way around this?

  • edited April 2020

    Yes, that's a limitation present right now. The "Basic" library is confined to an internal grid of 1nm.

    Codewise the change is simple, but as other users need bigger DBUs for accommodating large circles, a general change IMHO is not advisable. Ideally, a library would adjust to the destination layout database-unit wise. But that's a bigger change. You can file a ticket on GitHub ( regarding this, but it won't happen quickly.

    A quicker solution might be to supply an alternative "Basic" library with picometer resolution (i.e. "Basic_pm"). Objects pulled from there will then be confined to 2x2mm dimension roughly.

    Circles you can also do with a single-point path with round ends. For other shapes there is no such substitute.

    A workaround is to draw your layout on a 10x scale with a DBU of 1nm and before going to mask you scale it down to 0.1nm DBU.


  • Thanks for the reply.
    I've added an issue on GitHub as you suggested.

  • Thanks. I've seen the issue, but I can't promise a quick and elegant solution. The root cause is located deeply in the system.

    But I can provide the picometer variant easily.

    Kind regards,


Sign In or Register to comment.