ipkiss不仅提供常规形状生成函数,如Circle、Rectangle、Wedge等常规图形,还可以通过i3.Boundary生成任意形状。只需要给出形状的顶点坐标即可,如:
所有代码如下:
import ipkiss3.all as i3
class Shape(i3.PCell):
class Layout(i3.LayoutView):
def _generate_elements(self, elems):
elems += i3.Boundary(
layer=i3.Layer(1),
shape=[(0, 0), (7.7, -23.7),
(32.6, -23.7),(12.4, -38.4),
(20.1,-62.1),(0,-47.4),
(-20.1,-62.1),(-12.4,-38.4),
(-32.6,-23.7),(-7.7,-23.7)])
return elems
if __name__ == '__main__':
cell = Shape()
cell_lay = cell.Layout()
cell_lay.visualize()