child_cell1 = layout.create_cell("Theta1")
child_cell2 = layout.create_cell("Theta2")
child_cell3 = layout.create_cell("TEXT")
x = 1000000
y = 1000000
cell.insert(pya.CellInstArray(child_cell1.cell_index(), pya.Trans(-x, -y)))
cell.insert(
    pya.CellInstArray(child_cell2.cell_index(),
                      pya.CplxTrans(1, 0.00, False, -x, -y)))
cell.insert(pya.CellInstArray(child_cell3.cell_index(), pya.Trans(-x, -y)))

layer1 = layout.layer(10, 10)

paintertext = paintlib.ObjectPainter(layout)
list1 = list([0.01 * i for i in range(-5, 6)])
painter1 = paintlib.TransfilePainter(layout)
painter1.filename = "[taoke_theta1_test].gds"
painter2 = paintlib.TransfilePainter(layout)
painter2.filename = "[taoke_theta2_test].gds"
#tr=pya.DCplxTrans(1,0,False,0,0)
#倍数,逆时针度数,是否绕x翻转,平移x,平移y
for i, theta in enumerate(list1):
    dx = 25000000
    dy = 25000000
    paintertext.DrawText(
        child_cell3, layer1, theta,
        pya.DCplxTrans(10, 0, False, x + dx + 255000, y + dy + i * 40000))
    painter1.DrawGds(child_cell1, "theta1_%02d" % (i),
                     pya.DCplxTrans(1, 0, False, x + dx, y + dy + i * 40000))
    painter2.DrawGds(
        child_cell2, "theta2_%02d" % (i),
Exemplo n.º 2
0
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import paintlib

layout, top = paintlib.IO.Start("guinew")  # 在当前的图上继续画,如果没有就创建一个新的
layout.dbu = 0.001  # 设置单位长度为1nm
paintlib.IO.pointdistance = 1000  # 设置腔的精度,转弯处相邻两点的距离
paintlib.IO.SetWoringDir(__file__)
TBD = paintlib.TBD.init(6876587)
filepath = paintlib.IO.path + '/demos/'

# %%
layer = layout.layer(10, 10)
layer1 = layout.layer(10, 3)
layer2 = layout.layer(10, 2)

painter6 = paintlib.TransfilePainter(filepath + "CascadeRoutePaths.gds")
tr = pya.DCplxTrans(1, 0, False, 0, 0)
painter6.DrawGds(top, "layout0", tr)

cell = layout.create_cell("border")
top.insert(pya.CellInstArray(cell.cell_index(), pya.Trans(0, 400000)))

border = paintlib.BasicPainter.Border(leng=4550000, siz=4550000, wed=50000)
paintlib.BasicPainter.Draw(cell, layout.layer(0, 3), border)

cell = layout.create_cell("lines")
top.insert(pya.CellInstArray(cell.cell_index(), pya.Trans()))

inputs = [{
    "section": "Filter1",
    "PositionIn": [-2647, 3324, 180, "5105"],
Exemplo n.º 3
0
                                  bgn_ext=48000,
                                  end_ext=16000)
# painter3.painterin.Turning=painter3.painterin.TurningInterpolation
# painter3.painterout.Turning=painter3.painterout.TurningInterpolation

path = 'r 40000 s 50000 r 40000'
for i in range(7):
    path += f's{500000+40000*i} l 40000,180 s{500000+40000*i} r 40000,180'
path += 's 28500'

painter3.Run(path)  # Run内填字符串来描述的内径的运动
# s <length> 直行 r <radius[,angle]> 右转 l <radius[,angle]> 左转 n<number>[<content>] 重复number次content,可以嵌套循环

painter3.Draw(cell2, layer1)  # 把画好的腔置入
# 画Crossover
painter4 = paintlib.TransfilePainter(filepath + "crossover.gds")
painter4.airbridgedistance = 100000  # 设置Crossover的间距
painter4.DrawAirbridge(cell2, painter3.Getcenterlineinfo(), "Crossover1")

# 画腔
painter13 = paintlib.CavityPainter(pya.DPoint(-125000, 350000),
                                   angle=90,
                                   widout=16000,
                                   widin=8000,
                                   bgn_ext=0,
                                   end_ext=0)
painter13.Run('s 500000 l 50000 r 50000 s200000')
painter13.Draw(cell2, layer1)
# 画基于碰撞检测的Crossover
painter14 = paintlib.TransfilePainter(filepath + "crossover.gds")
painter14.airbridgedistance = 30000  # 设置Crossover的间距
Exemplo n.º 4
0
else:
    width = 8000
    height = 28000
    filename = 'abc.gds'
    outputfile = ''

if noguitest:
    layout, top = paintlib.IO.Start("gds")
else:
    layout, top = paintlib.IO.Start("guiopen")
layout.dbu = 0.001  # 设置单位长度为1nm
paintlib.IO.pointdistance = 1000
paintlib.IO.SetWoringDir(__file__)

if noguitest:
    painter = paintlib.TransfilePainter(filename=filename)
    painter.DrawGds(top, 'sourcefile', pya.DCplxTrans())


def extractABFromGDS(sourceLayerList=[(2, 0)]):
    output = []
    layers = paintlib.Collision.getLayers(layerList=sourceLayerList,
                                          layermod='in')
    for layer in layers:
        it = paintlib.IO.top.begin_shapes_rec(layer)
        while not it.at_end():
            shape_ = it.shape()
            area_ = shape_.area()

            if width * height * 0.98 < area_ < width * height * 1.02:
                # return shape_