New forge coding added
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
from typing import Any
|
||||
import nazca as nd
|
||||
import numpy as np
|
||||
import nazca.interconnects as IC
|
||||
|
||||
from ..structures import *
|
||||
from ..routing import *
|
||||
|
||||
from ..primitives.pic import *
|
||||
from ..electronics import Vias
|
||||
|
||||
from ..primitives.passive import waveguide
|
||||
|
||||
|
||||
class LoopMirror():
|
||||
def __init__(self,
|
||||
xs_wg: str='strip',
|
||||
w_wg: float=0.45,
|
||||
Radius: float = 20,
|
||||
angle: float = 45,
|
||||
sharp_patch: bool=True,
|
||||
BS: Any=None) -> None:
|
||||
with nd.Cell(instantiate=False) as C:
|
||||
if (BS==None):
|
||||
BS = DC(w_cp=0.45,gap=0.2,w_wg=w_wg,L_cp=10,R0=10,angle=20,xs=xs_wg,sharp_patch=True)
|
||||
BS_Inst = BS.cell.put(0,0,0) ## middle
|
||||
D_port = np.abs(BS_Inst.pin['b1'].y - BS_Inst.pin['b2'].y)
|
||||
pic = Route(radius=Radius,width=w_wg,xs=xs_wg)
|
||||
BU = nd.bend(radius=Radius,width=w_wg,xs=xs_wg,angle=angle).put('a0',BS_Inst.pin['b1'],flip=0)
|
||||
BD = nd.bend(radius=Radius,width=w_wg,xs=xs_wg,angle=angle).put('a0',BS_Inst.pin['b2'],flip=1)
|
||||
|
||||
|
||||
R_loop = (Radius+D_port/2)/np.cos(angle/180*np.pi) - Radius
|
||||
BC = nd.bend(radius=R_loop,width=w_wg,xs=xs_wg,angle=180+angle*2).put('a0',BU.pin['b0'],flip=1)
|
||||
|
||||
if (sharp_patch==True):
|
||||
for layers,growx,growy,acc in nd.layeriter(xs=xs_wg):
|
||||
(a1,b1), (a2,b2),c1,c2 = growx
|
||||
if (layers.find('CLD')!=-1):
|
||||
### middle patch
|
||||
nd.strt(length=(R_loop+w_wg*a1+b1)*(1+np.sin((180-angle)/180*np.pi))+(Radius)*np.sin(angle/180*np.pi),width=2*(R_loop+w_wg*a1+b1),layer=layers).put(BS_Inst.pin['b1'].x,0,0)
|
||||
|
||||
nd.Pin(name='a1',pin=BS_Inst.pin['a1']).put()
|
||||
|
||||
self.cell = C
|
||||
Reference in New Issue
Block a user