gds_example
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| gds_example [2025/11/27 09:41] – created alehen | gds_example [2025/11/27 09:45] (current) – alehen | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| UpperEllipse = gf.components.ellipse(radii = (d, y-w/2), layer = (1, 0)) | UpperEllipse = gf.components.ellipse(radii = (d, y-w/2), layer = (1, 0)) | ||
| HalfPad = gf.boolean(LeftPad, | HalfPad = gf.boolean(LeftPad, | ||
| - | |||
| return HalfPad | return HalfPad | ||
| Line 15: | Line 14: | ||
| UpPad = CreateHalfPad(pad[0], | UpPad = CreateHalfPad(pad[0], | ||
| DownPad = CreateHalfPad(pad[0], | DownPad = CreateHalfPad(pad[0], | ||
| - | |||
| AddedUpPad = pads.add_ref(UpPad) | AddedUpPad = pads.add_ref(UpPad) | ||
| AddedDownPad = pads.add_ref(DownPad) | AddedDownPad = pads.add_ref(DownPad) | ||
| - | |||
| AddedDownPad.mirror() | AddedDownPad.mirror() | ||
| AddedUpPad.rotate(180) | AddedUpPad.rotate(180) | ||
| AddedUpPad.move([0, | AddedUpPad.move([0, | ||
| - | |||
| TotalPad = gf.boolean(AddedUpPad, | TotalPad = gf.boolean(AddedUpPad, | ||
| return TotalPad | return TotalPad | ||
| Line 36: | Line 32: | ||
| layer=(1, 0), | layer=(1, 0), | ||
| ) | ) | ||
| - | |||
| return snspd | return snspd | ||
| Line 43: | Line 38: | ||
| Comp_Pad1 = gf.Component() #Temporary building blocks | Comp_Pad1 = gf.Component() #Temporary building blocks | ||
| Comp_Pad2 = gf.Component() #Temporary building blocks | Comp_Pad2 = gf.Component() #Temporary building blocks | ||
| - | |||
| SNSPDObj = CreateSNSPD(SNSPD[0], | SNSPDObj = CreateSNSPD(SNSPD[0], | ||
| - | |||
| SNSPDObjAdd = Comp_SNSPD.add_ref(SNSPDObj) | SNSPDObjAdd = Comp_SNSPD.add_ref(SNSPDObj) | ||
| SNSPDObjAdd.move([SNSPD[2][0]/ | SNSPDObjAdd.move([SNSPD[2][0]/ | ||
| - | |||
| Pad1 = CreatePad(pad = Pad) | Pad1 = CreatePad(pad = Pad) | ||
| Pad2 = CreatePad(pad = Pad) | Pad2 = CreatePad(pad = Pad) | ||
| - | |||
| Pad1.move([50, | Pad1.move([50, | ||
| - | |||
| #Pad 2 correction calculation | #Pad 2 correction calculation | ||
| #if math.floor((SNSPD[2][0])/ | #if math.floor((SNSPD[2][0])/ | ||
| Line 60: | Line 50: | ||
| else: | else: | ||
| correction = (round( (SNSPD[2][1])/ | correction = (round( (SNSPD[2][1])/ | ||
| - | |||
| if SNSPD[5] == False: | if SNSPD[5] == False: | ||
| Pad2.rotate(180) | Pad2.rotate(180) | ||
| Line 67: | Line 56: | ||
| correction = (round( (SNSPD[2][1] - 1.3*SNSPD[1])/ | correction = (round( (SNSPD[2][1] - 1.3*SNSPD[1])/ | ||
| Pad2.move([50, | Pad2.move([50, | ||
| - | |||
| Comp_SNSPD.add_ref(Pad1) | Comp_SNSPD.add_ref(Pad1) | ||
| Comp_SNSPD.add_ref(Pad2) | Comp_SNSPD.add_ref(Pad2) | ||
| - | |||
| # | # | ||
| - | |||
| ConstructionTemp = gf.boolean(SNSPDObjAdd, | ConstructionTemp = gf.boolean(SNSPDObjAdd, | ||
| Construction = gf.boolean(ConstructionTemp, | Construction = gf.boolean(ConstructionTemp, | ||
| - | |||
| Rect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | Rect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | ||
| Rect1C = Comp_Pad1.add_ref(Rect1) | Rect1C = Comp_Pad1.add_ref(Rect1) | ||
| Rect1C.move([-Pad[0] + 50, -10]) | Rect1C.move([-Pad[0] + 50, -10]) | ||
| - | |||
| Rect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | Rect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | ||
| Rect2C = Comp_Pad1.add_ref(Rect2) | Rect2C = Comp_Pad1.add_ref(Rect2) | ||
| Rect2C.move([-Pad[0] + 50, Pad[1] * 2 -10]) | Rect2C.move([-Pad[0] + 50, Pad[1] * 2 -10]) | ||
| - | |||
| Rect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0)) | Rect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0)) | ||
| Rect3C = Comp_Pad1.add_ref(Rect3) | Rect3C = Comp_Pad1.add_ref(Rect3) | ||
| Rect3C.move([-Pad[0] + 50, 0]) | Rect3C.move([-Pad[0] + 50, 0]) | ||
| - | |||
| Rect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | Rect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | ||
| Rect4C = Comp_Pad1.add_ref(Rect4) | Rect4C = Comp_Pad1.add_ref(Rect4) | ||
| Rect4C.move([-110, | Rect4C.move([-110, | ||
| - | |||
| Rect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | Rect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | ||
| Rect5C = Comp_Pad1.add_ref(Rect5) | Rect5C = Comp_Pad1.add_ref(Rect5) | ||
| Rect5C.move([-110, | Rect5C.move([-110, | ||
| - | |||
| correct = SNSPDObjAdd.ymin - SNSPDObjAdd.ymax + SNSPD[0] | correct = SNSPDObjAdd.ymin - SNSPDObjAdd.ymax + SNSPD[0] | ||
| - | |||
| SecondRect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | SecondRect1 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | ||
| SecondRect1C = Comp_Pad1.add_ref(SecondRect1) | SecondRect1C = Comp_Pad1.add_ref(SecondRect1) | ||
| SecondRect1C.move([-Pad[0] + 50, -10 + correct]) | SecondRect1C.move([-Pad[0] + 50, -10 + correct]) | ||
| - | |||
| SecondRect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | SecondRect2 = gf.components.rectangle(size = [Pad[0] - Pad[3], 20], layer=(2, 0)) | ||
| SecondRect2C = Comp_Pad1.add_ref(SecondRect2) | SecondRect2C = Comp_Pad1.add_ref(SecondRect2) | ||
| SecondRect2C.move([-Pad[0] + 50, Pad[1] * 2 -10 + correct]) | SecondRect2C.move([-Pad[0] + 50, Pad[1] * 2 -10 + correct]) | ||
| - | |||
| SecondRect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0)) | SecondRect3 = gf.components.rectangle(size = [20, Pad[1] * 2], layer=(2, 0)) | ||
| SecondRect3C = Comp_Pad1.add_ref(SecondRect3) | SecondRect3C = Comp_Pad1.add_ref(SecondRect3) | ||
| SecondRect3C.move([-Pad[0] + 50, correct]) | SecondRect3C.move([-Pad[0] + 50, correct]) | ||
| - | |||
| SecondRect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | SecondRect4 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | ||
| SecondRect4C = Comp_Pad1.add_ref(SecondRect4) | SecondRect4C = Comp_Pad1.add_ref(SecondRect4) | ||
| SecondRect4C.move([-110, | SecondRect4C.move([-110, | ||
| - | |||
| SecondRect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | SecondRect5 = gf.components.rectangle(size = [20, 100], layer=(2, 0)) | ||
| SecondRect5C = Comp_Pad1.add_ref(SecondRect5) | SecondRect5C = Comp_Pad1.add_ref(SecondRect5) | ||
| SecondRect5C.move([-110, | SecondRect5C.move([-110, | ||
| - | |||
| return Construction, | return Construction, | ||
| def CreatePositiveStructure(Pad, | def CreatePositiveStructure(Pad, | ||
| c = gf.Component() #Temporary building blocks | c = gf.Component() #Temporary building blocks | ||
| - | |||
| SNSPDObj = CreateSNSPD(SNSPD[0], | SNSPDObj = CreateSNSPD(SNSPD[0], | ||
| - | |||
| SNSPDObjAdd = c.add_ref(SNSPDObj) | SNSPDObjAdd = c.add_ref(SNSPDObj) | ||
| SNSPDObjAdd.move([SNSPD[2][0]/ | SNSPDObjAdd.move([SNSPD[2][0]/ | ||
| - | |||
| Pad1 = CreatePad(pad = Pad) | Pad1 = CreatePad(pad = Pad) | ||
| Pad2 = CreatePad(pad = Pad) | Pad2 = CreatePad(pad = Pad) | ||
| - | |||
| Pad1.move([50, | Pad1.move([50, | ||
| - | |||
| #Pad 2 correction calculation | #Pad 2 correction calculation | ||
| #if math.floor((SNSPD[2][0])/ | #if math.floor((SNSPD[2][0])/ | ||
| Line 139: | Line 108: | ||
| else: | else: | ||
| correction = (round( (SNSPD[2][1])/ | correction = (round( (SNSPD[2][1])/ | ||
| - | |||
| Pad2.rotate(180) | Pad2.rotate(180) | ||
| Pad2.move([50 + SNSPD[2][0], | Pad2.move([50 + SNSPD[2][0], | ||
| - | |||
| c.add_ref(Pad1) | c.add_ref(Pad1) | ||
| c.add_ref(Pad2) | c.add_ref(Pad2) | ||
| - | |||
| ConstructionTemp = gf.boolean(SNSPDObjAdd, | ConstructionTemp = gf.boolean(SNSPDObjAdd, | ||
| Construction = gf.boolean(ConstructionTemp, | Construction = gf.boolean(ConstructionTemp, | ||
| - | |||
| SNSPD_area = Construction.get_region(layer = (1, 0)) | SNSPD_area = Construction.get_region(layer = (1, 0)) | ||
| SNSPD_outline = SNSPD_area.sized(200) | SNSPD_outline = SNSPD_area.sized(200) | ||
| - | |||
| Final_SNSPD = SNSPD_outline - SNSPD_area | Final_SNSPD = SNSPD_outline - SNSPD_area | ||
| - | |||
| - | |||
| - | |||
| return Final_SNSPD | return Final_SNSPD | ||
| Line 179: | Line 140: | ||
| SNSPD.name = (str(WireWidth[i]) + "nm width " + str(FillingFactor[j]) + " ff") | SNSPD.name = (str(WireWidth[i]) + "nm width " + str(FillingFactor[j]) + " ff") | ||
| print(SNSPD.name) | print(SNSPD.name) | ||
| - | |||
| RectC = Temp.add_ref(Rect) | RectC = Temp.add_ref(Rect) | ||
| - | |||
| SNSPDNeg = c2.add_ref(SNSPD, | SNSPDNeg = c2.add_ref(SNSPD, | ||
| SNSPDNeg.move([i* 1600, j*1600]) | SNSPDNeg.move([i* 1600, j*1600]) | ||
gds_example.1764232876.txt.gz · Last modified: by alehen
