Closed joamatab closed 4 months ago
For non-manhattan cells (basically any cell you don't want snapped until you finished a circuit) you need to use virtual cells. A bend (non-90°) is affected by this.
E.g. this test does almost exactly what you want (test_virtual.py):
def test_virtual_cell_insert(
LAYER: kf.LayerEnum, straight: kf.KCell, wg_enc: kf.LayerEnclosure
) -> None:
c = kf.KCell()
vc = kf.VKCell("test_virtual_insert")
e_bend = kf.cells.virtual.euler.virtual_bend_euler(
width=0.5,
radius=10,
layer=LAYER.WG,
angle=25,
enclosure=wg_enc,
)
e1 = vc << e_bend
e2 = vc << e_bend
e3 = vc << e_bend
e4 = vc << e_bend
_s = kf.cells.virtual.straight.straight(
width=0.5, length=10, layer=LAYER.WG, enclosure=wg_enc
)
s = vc << _s
s.connect("o1", e1, "o2")
e2.connect("o1", s, "o2")
e3.connect("o1", e2, "o2")
e4.connect("o2", e3, "o2")
s2 = vc << straight
s2.connect("o1", e4, "o1")
vi = kf.VInstance(vc)
vi.insert_into(c)
c.show()
What's the recommended way of snapping non manhattan components?
for example, this creates 1nm gaps