How to use the klayout.db.DPolygon.new 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 jonpry / Pill / runtime.py View on Github external
def rodCreatePolygon(name,layer,fromObj=None):
   print("rodCreatePolygon: \"" + name + "\", " + str(layer))
   l1 = maplayer(layer)
   assert(l1 >= 0)  
   r = db.DPolygon.new(db.DBox.new(fromObj['lL'][0],fromObj['lL'][1],fromObj['uR'][0],fromObj['uR'][1]))
   r = top.shapes(l1).insert(r)

   obj = createObj(subs=[r])
   rodsByName[name] = obj
   return obj
github jonpry / Pill / runtime.py View on Github external
def dbCreatePolygon(cv,layer,pts):
   print("dbCreatePolygon: \"" + str(cv) + "\", " + str(layer))
   l1 = maplayer(layer)
   assert(l1 >= 0)  
   dpts = []
   for p in pts:
      dpts.append(db.DPoint.new(p[0],p[1]))  
   r = db.DPolygon.new(dpts)
   r = top.shapes(l1).insert(r)