How to use the klayout.db function in klayout

To help you get started, we’ve selected a few klayout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KLayout / klayout / testdata / pymod / import_db.py View on Github external
def test_1(self):
    self.assertEqual("Box" in db.__all__, True)
github jonpry / Pill / geom.py View on Github external
def Path(dpts,width,justification):
   path = db.DPath.new()
   path.width = width

   ds=[]
   for i in range(len(dpts)-1):
      apt = dpts[i]
      bpt = dpts[i+1]
      if bpt.x > apt.x:
        d = 'R'
      elif bpt.y > apt.y:
        d = 'U'
      elif bpt.x < apt.x:
        d = 'L'
      elif bpt.y < apt.y:
        d = 'D'
      else:
        assert(False)
github lukasc-ubc / SiEPIC-Tools / klayout_dot_config / tech / GSiP / pymacros / pcells_GSiP / __init__.py View on Github external
import os, sys
from pathlib import Path
import SiEPIC, siepic_tools

op_tag = "" #operation tag which defines whether we are loading library in script or GUI env

try:
  # import pya from klayout
  import pya
  if("Application" in str(dir(pya))):
    from SiEPIC.utils import get_technology_by_name
    op_tag = "GUI" 
    #import pya functions
  else:
    raise ImportError

except:
  import klayout.db as pya
  from zeropdk import Tech
  op_tag = "script" 
  lyp_filepath = Path(str(Path(os.path.dirname(os.path.realpath(__file__))).parent) + r"/klayout_Layers_GSiP.lyp")
  print(lyp_filepath)

from pya import Box, Point, Polygon, Text, Trans, LayerInfo, \
    PCellDeclarationHelper, DPoint, DPath, Path, ShapeProcessor, \
    Library, CellInstArray