加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
20210325_3_polygoanl_with_ref.py 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
xiaoyu 提交于 2021-03-25 22:30 . sth
import gdspy as gs
lib = gs.GdsLibrary()
cell = lib.new_cell('l1')
X = 0
Y = 0
points1 = [(X-5,Y-2.5), (X-5,Y+2.5), (X-79,Y+2.5), (X-79,Y-83), (X-39,Y-83), (X-39,Y-17.5), (X+39, Y-17.5), (X+39,Y-83),(X+79,Y-83),
(X+79,Y+2.5),(X+5,Y+2.5),(X+5,Y-2.5),(X+74,Y-2.5),(X+74,Y-78),(X+44,Y-78),(X+44,Y-12.5),(X-44,Y-12.5),(X-44,Y-78),(X-74,Y-78),(X-74,Y-2.5)]
points2 = [(X-36,Y-20.5),(X-36,Y-160.5),(X-124,Y-160.5),(X-124,Y-148.5),(X-182,Y-148.5),(X-182,Y-244.5),(X-124,Y-244.5),(X-124,Y-232.5),
(X-36,Y-232.5),(X-36,Y-318.5),(X-9,Y-318.5),(X-9,Y-314.5),(X-11,Y-314.5),(X-11,Y-312.5),(X-7,Y-312.5),(X-7,Y-318.5),
(X+7,Y-318.5),(X+7,Y-312.5),(X+11,Y-312.5),(X+11,Y-314.5),(X+9,Y-314.5),(X+9,Y-318.5),(X+36,Y-318.5),(X+36,Y-232.5),
(X+124,Y-232.5),(X+124,Y-244.5),(X+182,Y-244.5),(X+182,Y-148.5),(X+124,Y-148.5),(X+124,Y-160.5),(X+36,Y-160.5),
(X+36,Y-20.5)]
points3 = [(X-12,Y-44.5),(X-12,Y-184.5),(X-148,Y-184.5),(X-148,Y-180.5),(X-172,Y-180.5),(X-172,Y-212.5),(X-148,Y-212.5),(X-148,Y-208.5),
(X-12,Y-208.5),(X-12,Y-300.5),(X-1.5,Y-300.5),(X-1.5,Y-306.5),(X+2.5,Y-306.5),(X+2.5,Y-304.5),(X+0.5,Y-304.5),(X+0.5,Y-300.5),(X+12,Y-300.5),
(X+12,Y-208.5),(X+148,Y-208.5),(X+148,Y-212.5),(X+172,Y-212.5),(X+172,Y-180.5),(X+148,Y-180.5),(X+148,Y-184.5),(X+12,Y-184.5),(X+12,Y-44.5)]
poly1 = gs.Polygon(points1)
poly2 = gs.Polygon(points2)
poly3 = gs.Polygon(points3)
cap_fin = gs.boolean(poly2,poly3,"not")
cell.add(poly1)
cell.add(cap_fin)
lib.write_gds('E:/python/xiaoyu_GDSTest/corepart_1.gds')
gs.LayoutViewer(lib)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化