qiskit_metal.qlibrary.QNLMetal.manhattanjunction
ManhattanJunction
`vlead0`
|
‖ `inside_corner`
|‾| /
| | /
__________ | | /
| _ |____|_|/___________
| | |=| |*| |=- `hlead_0`
| / ‾ /|‾‾‾‾|‾|‾‾‾‾‾‾‾‾‾‾‾‾
‾‾‾‾/‾‾‾/‾ | |
/ / | | `vlead1`
`hcontact` | | /
/ | | /
/ | |/
`hlead1` |‾‾ ‖ ‾‾|
| |‾| |
| /‾ |
| / |
|/ |
/‾‾‾‾‾‾‾
`vcontact`
1# This code was written by Deval Deliwala. 2# 3# This code is to be used by QNL. 4# 5# Any modifications or derivative works of this code must retain this 6# notice, and modified files need to carry a notice indicating 7# that they have been altered from the originals. 8 9""" ManhattanJunction 10 11.. code-block:: 12 13 14 `vlead0` 15 | 16 ‖ `inside_corner` 17 |‾| / 18 | | / 19 __________ | | / 20 | _ |____|_|/___________ 21 | | |=| |*| |=- `hlead_0` 22 | / ‾ /|‾‾‾‾|‾|‾‾‾‾‾‾‾‾‾‾‾‾ 23 ‾‾‾‾/‾‾‾/‾ | | 24 / / | | `vlead1` 25 `hcontact` | | / 26 / | | / 27 / | |/ 28 `hlead1` |‾‾ ‖ ‾‾| 29 | |‾| | 30 | /‾ | 31 | / | 32 |/ | 33 /‾‾‾‾‾‾‾ 34 `vcontact` 35 36""" 37 38import numpy as np 39from qiskit_metal import draw, Dict 40from qiskit_metal.qlibrary.core import QComponent 41from qiskit_metal.toolbox_python.utility_functions import rotate_point 42 43 44 45class ManhattanJunction(QComponent): 46 """ 47 Inherits from `QComponent` Class. 48 49 Description: 50 QNL Manhattan Junctions. 51 This junction mask design has been optimized for wafer scale junction uniformity. 52 53 Options: 54 * junction_hw: Horizontal junction width 55 * junction_vw: Vertical junction width 56 * junction_hl: Horizontal junction length 57 * junction_vl: Vertical junction length 58 * wire_hw : Horizontal wire width 59 * wire_vw : Vertical wire width 60 * taper_length: Length of taper from wire width to junction width 61 * extra_hl: Extra length for horizontal junction segment AFTER intersection 62 * extra_vl: Extra length for vertical junction segment AFTER intersection 63 * contact_nw : A multiplier specifying the width of the narrow contact piece 64 This is multiplied by the junction width 65 * contact_ww : A multiplier specifying the width of the wide contact piece 66 This is multiplied by the junction width 67 * contact_nl : The length of the narrow contact piece 68 * contact_wl : THe length of the wide contact piece 69 * undercut_l : The length of the undercut after the junction segments 70 * undercut_w : The width of the undercut after the junction segments 71 * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise 72 * pos_x/_y : `origin` position of junction lead on chip 73 `origin` is the left-edge-center of the wide-section 74 * layer : The layer number for the junction lines 75 * undercut_layer : The layer number for the edge undercut leads 76 77 78 """ 79 80 # Default drawing options 81 default_options = Dict( 82 junction_hw='10um', 83 junction_vw='10um', 84 junction_hl='100um', 85 junction_vl='100um', 86 wire_hw='5um', 87 wire_vw='5um', 88 taper_length='20um', 89 extra_hl='10um', 90 extra_vl='50um', 91 contact_nw=0.5, 92 contact_ww=1, 93 contact_nl='2um', 94 contact_wl='5um', 95 undercut_l= '150um', 96 undercut_w='30um', 97 orientation='0', 98 pos_x='0um', 99 pos_y='0um', 100 layer='1', 101 undercut_layer='2', 102 ) 103 104 # Component metadata 105 # Name prefix for component, if user doesn't provide name 106 component_metadata = Dict( 107 short_name='ManhattanJunction', 108 _qgeometry_table_poly='True', 109 ) 110 111 def make(self): 112 """ Converts self.options into QGeometry. """ 113 p = self.parse_options() 114 nodes = Dict() 115 116 # Junction Rectangles 117 h_junction = draw.rectangle(p.junction_hl, p.junction_hw) 118 h_junction = draw.translate(h_junction, (p.junction_hl-p.junction_vw)/2, 0) 119 120 v_junction = draw.rectangle(p.junction_vl, p.junction_vw) 121 v_junction = draw.translate(v_junction, (p.junction_vl-p.junction_hw)/2, 0) 122 123 # Wire-Junction taper 124 h_triangles = [ 125 draw.Polygon([ 126 (-p.taper_length/2, +p.junction_hw/2), 127 (+p.taper_length/2, +p.junction_hw/2), 128 (+p.taper_length/2, +p.wire_hw/2), 129 ]), 130 draw.Polygon([ 131 (-p.taper_length/2, -p.junction_hw/2), 132 (+p.taper_length/2, -p.junction_hw/2), 133 (+p.taper_length/2, -p.wire_hw/2), 134 ]), 135 ] 136 137 v_triangles = [ 138 draw.Polygon([ 139 (-p.taper_length/2, +p.junction_vw/2), 140 (+p.taper_length/2, +p.junction_vw/2), 141 (+p.taper_length/2, +p.wire_vw/2), 142 ]), 143 draw.Polygon([ 144 (-p.taper_length/2, -p.junction_vw/2), 145 (+p.taper_length/2, -p.junction_vw/2), 146 (+p.taper_length/2, -p.wire_vw/2), 147 ]), 148 ] 149 150 h_taper = draw.rectangle(p.taper_length, p.junction_hw) 151 h_taper = draw.subtract(h_taper, h_triangles[0]) 152 h_taper = draw.subtract(h_taper, h_triangles[1]) 153 h_taper = draw.translate(h_taper, p.junction_hl + (-p.junction_vw+p.taper_length)/2, 0) 154 155 v_taper = draw.rectangle(p.taper_length, p.junction_vw) 156 v_taper = draw.subtract(v_taper, v_triangles[0]) 157 v_taper = draw.subtract(v_taper, v_triangles[1]) 158 v_taper = draw.translate(v_taper, p.junction_vl + (-p.junction_hw+p.taper_length)/2, 0) 159 160 161 # Junction Extensions 162 h_extension = draw.rectangle(p.extra_hl, p.junction_hw) 163 h_extension = draw.translate(h_extension, -(p.junction_vw+p.extra_hl)/2, 0) 164 165 v_extension = draw.rectangle(p.extra_vl, p.junction_vw) 166 v_extension = draw.translate(v_extension, -(p.junction_hw+p.extra_vl)/2, 0) 167 168 # Narrow contacts 169 h_narrow = draw.rectangle(p.contact_nl, p.contact_nw*p.junction_hw) 170 v_narrow = draw.rectangle(p.contact_nl, p.contact_nw*p.junction_vw) 171 172 h_narrow = draw.translate(h_narrow, -(p.extra_hl + (p.contact_nl + p.junction_vw)/2), 0) 173 v_narrow = draw.translate(v_narrow, -(p.extra_vl + (p.contact_nl + p.junction_hw)/2), 0) 174 175 # Wide contacts 176 h_wide = draw.rectangle(p.contact_wl, p.contact_ww*p.junction_hw) 177 v_wide = draw.rectangle(p.contact_wl, p.contact_ww*p.junction_vw) 178 179 h_wide = draw.translate(h_wide, -(p.extra_hl + p.contact_nl + (p.contact_wl + p.junction_vw)/2), 0) 180 v_wide = draw.translate(v_wide, -(p.extra_vl + p.contact_nl + (p.contact_wl + p.junction_hw)/2), 0) 181 182 # Undercut pads 183 undercut = draw.rectangle(p.undercut_l, p.undercut_w) 184 h_undercut = draw.translate(undercut, -(p.extra_hl + (p.junction_vw+p.undercut_l)/2), 0) 185 v_undercut = draw.translate(undercut, -(p.extra_vl + (p.junction_hw+p.undercut_l)/2), 0) 186 187 # Combining all non-undercut components into `junction` 188 # Applying 90 deg rotation to vertical junction 189 h_junction = draw.union([h_junction, h_taper, h_extension, h_narrow, h_wide]) 190 v_junction = draw.union([v_junction, v_taper, v_extension, v_narrow, v_wide]) 191 192 v_undercut = draw.rotate(v_undercut, 90.0, origin=(0, 0)) 193 v_junction = draw.rotate(v_junction, 90.0, origin=(0, 0)) 194 junction = draw.union([h_junction, v_junction]) 195 undercut = draw.union([h_undercut, v_undercut]) 196 197 # Translations & Rotations 198 geom_list = [junction, undercut] 199 geom_list = draw.rotate(geom_list, p.orientation, origin=(0, 0)) 200 geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 201 junction, undercut = geom_list 202 203 # Converting drawing to qgeometry 204 self.add_qgeometry('poly', {'junction': junction}, layer=p.layer) 205 self.add_qgeometry('poly', {'undercut': undercut}, layer=p.undercut_layer) 206 207 # Positioning nodes 208 nodes.origin = np.zeros(2) 209 nodes.hlead0 = np.array((p.taper_length + p.junction_hl - p.junction_vw/2, 0)) 210 nodes.hlead1 = np.array((-(p.junction_vw/2 + p.extra_hl), 0)) 211 nodes.vlead0 = np.array((0, p.taper_length + p.junction_vl - p.junction_hw/2)) 212 nodes.vlead1 = np.array((0, -(p.junction_hw/2 + p.extra_vl))) 213 nodes.hcontact = nodes.hlead1 + np.array((-p.contact_wl-p.contact_nl, 0)) 214 nodes.vcontact = nodes.vlead1 + np.array((0, -p.contact_wl-p.contact_nl)) 215 nodes.inside_corner = nodes.origin + np.array((p.junction_hw/2, p.junction_vw/2)) 216 217 # Moving nodes along with component 218 translation_vec = np.array((p.pos_x, p.pos_y)) 219 theta = np.deg2rad(p.orientation) 220 221 for key, point in nodes.items(): 222 rotated = rotate_point(point, theta) 223 nodes[key] = rotated + translation_vec 224 225 self.nodes = nodes 226 return 227 228 def node(self, key): 229 return self.nodes.get(key, None)
46class ManhattanJunction(QComponent): 47 """ 48 Inherits from `QComponent` Class. 49 50 Description: 51 QNL Manhattan Junctions. 52 This junction mask design has been optimized for wafer scale junction uniformity. 53 54 Options: 55 * junction_hw: Horizontal junction width 56 * junction_vw: Vertical junction width 57 * junction_hl: Horizontal junction length 58 * junction_vl: Vertical junction length 59 * wire_hw : Horizontal wire width 60 * wire_vw : Vertical wire width 61 * taper_length: Length of taper from wire width to junction width 62 * extra_hl: Extra length for horizontal junction segment AFTER intersection 63 * extra_vl: Extra length for vertical junction segment AFTER intersection 64 * contact_nw : A multiplier specifying the width of the narrow contact piece 65 This is multiplied by the junction width 66 * contact_ww : A multiplier specifying the width of the wide contact piece 67 This is multiplied by the junction width 68 * contact_nl : The length of the narrow contact piece 69 * contact_wl : THe length of the wide contact piece 70 * undercut_l : The length of the undercut after the junction segments 71 * undercut_w : The width of the undercut after the junction segments 72 * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise 73 * pos_x/_y : `origin` position of junction lead on chip 74 `origin` is the left-edge-center of the wide-section 75 * layer : The layer number for the junction lines 76 * undercut_layer : The layer number for the edge undercut leads 77 78 79 """ 80 81 # Default drawing options 82 default_options = Dict( 83 junction_hw='10um', 84 junction_vw='10um', 85 junction_hl='100um', 86 junction_vl='100um', 87 wire_hw='5um', 88 wire_vw='5um', 89 taper_length='20um', 90 extra_hl='10um', 91 extra_vl='50um', 92 contact_nw=0.5, 93 contact_ww=1, 94 contact_nl='2um', 95 contact_wl='5um', 96 undercut_l= '150um', 97 undercut_w='30um', 98 orientation='0', 99 pos_x='0um', 100 pos_y='0um', 101 layer='1', 102 undercut_layer='2', 103 ) 104 105 # Component metadata 106 # Name prefix for component, if user doesn't provide name 107 component_metadata = Dict( 108 short_name='ManhattanJunction', 109 _qgeometry_table_poly='True', 110 ) 111 112 def make(self): 113 """ Converts self.options into QGeometry. """ 114 p = self.parse_options() 115 nodes = Dict() 116 117 # Junction Rectangles 118 h_junction = draw.rectangle(p.junction_hl, p.junction_hw) 119 h_junction = draw.translate(h_junction, (p.junction_hl-p.junction_vw)/2, 0) 120 121 v_junction = draw.rectangle(p.junction_vl, p.junction_vw) 122 v_junction = draw.translate(v_junction, (p.junction_vl-p.junction_hw)/2, 0) 123 124 # Wire-Junction taper 125 h_triangles = [ 126 draw.Polygon([ 127 (-p.taper_length/2, +p.junction_hw/2), 128 (+p.taper_length/2, +p.junction_hw/2), 129 (+p.taper_length/2, +p.wire_hw/2), 130 ]), 131 draw.Polygon([ 132 (-p.taper_length/2, -p.junction_hw/2), 133 (+p.taper_length/2, -p.junction_hw/2), 134 (+p.taper_length/2, -p.wire_hw/2), 135 ]), 136 ] 137 138 v_triangles = [ 139 draw.Polygon([ 140 (-p.taper_length/2, +p.junction_vw/2), 141 (+p.taper_length/2, +p.junction_vw/2), 142 (+p.taper_length/2, +p.wire_vw/2), 143 ]), 144 draw.Polygon([ 145 (-p.taper_length/2, -p.junction_vw/2), 146 (+p.taper_length/2, -p.junction_vw/2), 147 (+p.taper_length/2, -p.wire_vw/2), 148 ]), 149 ] 150 151 h_taper = draw.rectangle(p.taper_length, p.junction_hw) 152 h_taper = draw.subtract(h_taper, h_triangles[0]) 153 h_taper = draw.subtract(h_taper, h_triangles[1]) 154 h_taper = draw.translate(h_taper, p.junction_hl + (-p.junction_vw+p.taper_length)/2, 0) 155 156 v_taper = draw.rectangle(p.taper_length, p.junction_vw) 157 v_taper = draw.subtract(v_taper, v_triangles[0]) 158 v_taper = draw.subtract(v_taper, v_triangles[1]) 159 v_taper = draw.translate(v_taper, p.junction_vl + (-p.junction_hw+p.taper_length)/2, 0) 160 161 162 # Junction Extensions 163 h_extension = draw.rectangle(p.extra_hl, p.junction_hw) 164 h_extension = draw.translate(h_extension, -(p.junction_vw+p.extra_hl)/2, 0) 165 166 v_extension = draw.rectangle(p.extra_vl, p.junction_vw) 167 v_extension = draw.translate(v_extension, -(p.junction_hw+p.extra_vl)/2, 0) 168 169 # Narrow contacts 170 h_narrow = draw.rectangle(p.contact_nl, p.contact_nw*p.junction_hw) 171 v_narrow = draw.rectangle(p.contact_nl, p.contact_nw*p.junction_vw) 172 173 h_narrow = draw.translate(h_narrow, -(p.extra_hl + (p.contact_nl + p.junction_vw)/2), 0) 174 v_narrow = draw.translate(v_narrow, -(p.extra_vl + (p.contact_nl + p.junction_hw)/2), 0) 175 176 # Wide contacts 177 h_wide = draw.rectangle(p.contact_wl, p.contact_ww*p.junction_hw) 178 v_wide = draw.rectangle(p.contact_wl, p.contact_ww*p.junction_vw) 179 180 h_wide = draw.translate(h_wide, -(p.extra_hl + p.contact_nl + (p.contact_wl + p.junction_vw)/2), 0) 181 v_wide = draw.translate(v_wide, -(p.extra_vl + p.contact_nl + (p.contact_wl + p.junction_hw)/2), 0) 182 183 # Undercut pads 184 undercut = draw.rectangle(p.undercut_l, p.undercut_w) 185 h_undercut = draw.translate(undercut, -(p.extra_hl + (p.junction_vw+p.undercut_l)/2), 0) 186 v_undercut = draw.translate(undercut, -(p.extra_vl + (p.junction_hw+p.undercut_l)/2), 0) 187 188 # Combining all non-undercut components into `junction` 189 # Applying 90 deg rotation to vertical junction 190 h_junction = draw.union([h_junction, h_taper, h_extension, h_narrow, h_wide]) 191 v_junction = draw.union([v_junction, v_taper, v_extension, v_narrow, v_wide]) 192 193 v_undercut = draw.rotate(v_undercut, 90.0, origin=(0, 0)) 194 v_junction = draw.rotate(v_junction, 90.0, origin=(0, 0)) 195 junction = draw.union([h_junction, v_junction]) 196 undercut = draw.union([h_undercut, v_undercut]) 197 198 # Translations & Rotations 199 geom_list = [junction, undercut] 200 geom_list = draw.rotate(geom_list, p.orientation, origin=(0, 0)) 201 geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 202 junction, undercut = geom_list 203 204 # Converting drawing to qgeometry 205 self.add_qgeometry('poly', {'junction': junction}, layer=p.layer) 206 self.add_qgeometry('poly', {'undercut': undercut}, layer=p.undercut_layer) 207 208 # Positioning nodes 209 nodes.origin = np.zeros(2) 210 nodes.hlead0 = np.array((p.taper_length + p.junction_hl - p.junction_vw/2, 0)) 211 nodes.hlead1 = np.array((-(p.junction_vw/2 + p.extra_hl), 0)) 212 nodes.vlead0 = np.array((0, p.taper_length + p.junction_vl - p.junction_hw/2)) 213 nodes.vlead1 = np.array((0, -(p.junction_hw/2 + p.extra_vl))) 214 nodes.hcontact = nodes.hlead1 + np.array((-p.contact_wl-p.contact_nl, 0)) 215 nodes.vcontact = nodes.vlead1 + np.array((0, -p.contact_wl-p.contact_nl)) 216 nodes.inside_corner = nodes.origin + np.array((p.junction_hw/2, p.junction_vw/2)) 217 218 # Moving nodes along with component 219 translation_vec = np.array((p.pos_x, p.pos_y)) 220 theta = np.deg2rad(p.orientation) 221 222 for key, point in nodes.items(): 223 rotated = rotate_point(point, theta) 224 nodes[key] = rotated + translation_vec 225 226 self.nodes = nodes 227 return 228 229 def node(self, key): 230 return self.nodes.get(key, None)
Inherits from QComponent
Class.
Description: QNL Manhattan Junctions. This junction mask design has been optimized for wafer scale junction uniformity.
Options:
* junction_hw: Horizontal junction width
* junction_vw: Vertical junction width
* junction_hl: Horizontal junction length
* junction_vl: Vertical junction length
* wire_hw : Horizontal wire width
* wire_vw : Vertical wire width
* taper_length: Length of taper from wire width to junction width
* extra_hl: Extra length for horizontal junction segment AFTER intersection
* extra_vl: Extra length for vertical junction segment AFTER intersection
* contact_nw : A multiplier specifying the width of the narrow contact piece
This is multiplied by the junction width
* contact_ww : A multiplier specifying the width of the wide contact piece
This is multiplied by the junction width
* contact_nl : The length of the narrow contact piece
* contact_wl : THe length of the wide contact piece
* undercut_l : The length of the undercut after the junction segments
* undercut_w : The width of the undercut after the junction segments
* orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise
* pos_x/_y : origin
position of junction lead on chip
origin
is the left-edge-center of the wide-section
* layer : The layer number for the junction lines
* undercut_layer : The layer number for the edge undercut leads
Default drawing options
Component metadata
112 def make(self): 113 """ Converts self.options into QGeometry. """ 114 p = self.parse_options() 115 nodes = Dict() 116 117 # Junction Rectangles 118 h_junction = draw.rectangle(p.junction_hl, p.junction_hw) 119 h_junction = draw.translate(h_junction, (p.junction_hl-p.junction_vw)/2, 0) 120 121 v_junction = draw.rectangle(p.junction_vl, p.junction_vw) 122 v_junction = draw.translate(v_junction, (p.junction_vl-p.junction_hw)/2, 0) 123 124 # Wire-Junction taper 125 h_triangles = [ 126 draw.Polygon([ 127 (-p.taper_length/2, +p.junction_hw/2), 128 (+p.taper_length/2, +p.junction_hw/2), 129 (+p.taper_length/2, +p.wire_hw/2), 130 ]), 131 draw.Polygon([ 132 (-p.taper_length/2, -p.junction_hw/2), 133 (+p.taper_length/2, -p.junction_hw/2), 134 (+p.taper_length/2, -p.wire_hw/2), 135 ]), 136 ] 137 138 v_triangles = [ 139 draw.Polygon([ 140 (-p.taper_length/2, +p.junction_vw/2), 141 (+p.taper_length/2, +p.junction_vw/2), 142 (+p.taper_length/2, +p.wire_vw/2), 143 ]), 144 draw.Polygon([ 145 (-p.taper_length/2, -p.junction_vw/2), 146 (+p.taper_length/2, -p.junction_vw/2), 147 (+p.taper_length/2, -p.wire_vw/2), 148 ]), 149 ] 150 151 h_taper = draw.rectangle(p.taper_length, p.junction_hw) 152 h_taper = draw.subtract(h_taper, h_triangles[0]) 153 h_taper = draw.subtract(h_taper, h_triangles[1]) 154 h_taper = draw.translate(h_taper, p.junction_hl + (-p.junction_vw+p.taper_length)/2, 0) 155 156 v_taper = draw.rectangle(p.taper_length, p.junction_vw) 157 v_taper = draw.subtract(v_taper, v_triangles[0]) 158 v_taper = draw.subtract(v_taper, v_triangles[1]) 159 v_taper = draw.translate(v_taper, p.junction_vl + (-p.junction_hw+p.taper_length)/2, 0) 160 161 162 # Junction Extensions 163 h_extension = draw.rectangle(p.extra_hl, p.junction_hw) 164 h_extension = draw.translate(h_extension, -(p.junction_vw+p.extra_hl)/2, 0) 165 166 v_extension = draw.rectangle(p.extra_vl, p.junction_vw) 167 v_extension = draw.translate(v_extension, -(p.junction_hw+p.extra_vl)/2, 0) 168 169 # Narrow contacts 170 h_narrow = draw.rectangle(p.contact_nl, p.contact_nw*p.junction_hw) 171 v_narrow = draw.rectangle(p.contact_nl, p.contact_nw*p.junction_vw) 172 173 h_narrow = draw.translate(h_narrow, -(p.extra_hl + (p.contact_nl + p.junction_vw)/2), 0) 174 v_narrow = draw.translate(v_narrow, -(p.extra_vl + (p.contact_nl + p.junction_hw)/2), 0) 175 176 # Wide contacts 177 h_wide = draw.rectangle(p.contact_wl, p.contact_ww*p.junction_hw) 178 v_wide = draw.rectangle(p.contact_wl, p.contact_ww*p.junction_vw) 179 180 h_wide = draw.translate(h_wide, -(p.extra_hl + p.contact_nl + (p.contact_wl + p.junction_vw)/2), 0) 181 v_wide = draw.translate(v_wide, -(p.extra_vl + p.contact_nl + (p.contact_wl + p.junction_hw)/2), 0) 182 183 # Undercut pads 184 undercut = draw.rectangle(p.undercut_l, p.undercut_w) 185 h_undercut = draw.translate(undercut, -(p.extra_hl + (p.junction_vw+p.undercut_l)/2), 0) 186 v_undercut = draw.translate(undercut, -(p.extra_vl + (p.junction_hw+p.undercut_l)/2), 0) 187 188 # Combining all non-undercut components into `junction` 189 # Applying 90 deg rotation to vertical junction 190 h_junction = draw.union([h_junction, h_taper, h_extension, h_narrow, h_wide]) 191 v_junction = draw.union([v_junction, v_taper, v_extension, v_narrow, v_wide]) 192 193 v_undercut = draw.rotate(v_undercut, 90.0, origin=(0, 0)) 194 v_junction = draw.rotate(v_junction, 90.0, origin=(0, 0)) 195 junction = draw.union([h_junction, v_junction]) 196 undercut = draw.union([h_undercut, v_undercut]) 197 198 # Translations & Rotations 199 geom_list = [junction, undercut] 200 geom_list = draw.rotate(geom_list, p.orientation, origin=(0, 0)) 201 geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 202 junction, undercut = geom_list 203 204 # Converting drawing to qgeometry 205 self.add_qgeometry('poly', {'junction': junction}, layer=p.layer) 206 self.add_qgeometry('poly', {'undercut': undercut}, layer=p.undercut_layer) 207 208 # Positioning nodes 209 nodes.origin = np.zeros(2) 210 nodes.hlead0 = np.array((p.taper_length + p.junction_hl - p.junction_vw/2, 0)) 211 nodes.hlead1 = np.array((-(p.junction_vw/2 + p.extra_hl), 0)) 212 nodes.vlead0 = np.array((0, p.taper_length + p.junction_vl - p.junction_hw/2)) 213 nodes.vlead1 = np.array((0, -(p.junction_hw/2 + p.extra_vl))) 214 nodes.hcontact = nodes.hlead1 + np.array((-p.contact_wl-p.contact_nl, 0)) 215 nodes.vcontact = nodes.vlead1 + np.array((0, -p.contact_wl-p.contact_nl)) 216 nodes.inside_corner = nodes.origin + np.array((p.junction_hw/2, p.junction_vw/2)) 217 218 # Moving nodes along with component 219 translation_vec = np.array((p.pos_x, p.pos_y)) 220 theta = np.deg2rad(p.orientation) 221 222 for key, point in nodes.items(): 223 rotated = rotate_point(point, theta) 224 nodes[key] = rotated + translation_vec 225 226 self.nodes = nodes 227 return
Converts self.options into QGeometry.