Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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)