def create_t3(self): cell = spira.Cell() tf_1 = spira.Translation(Coord(12.5, 2.5)) + spira.Rotation(60) tf_2 = spira.Translation(Coord( 12.5, 2.5)) + spira.Rotation(60) + spira.Reflection(True) cell += spira.Rectangle(p1=(0, 0), p2=(10, 50), layer=spira.Layer(number=4)) S1 = spira.SRef(cell, transformation=tf_1) S2 = spira.SRef(cell, transformation=tf_2) return [S1, S2]
def create_elementals(self, elems): c1 = PolygonCell() s1 = spira.SRef(c1, midpoint=(0, 0)) elems += s1 T = spira.Translation((0 * 1e6, -40 * 1e6)) + spira.Rotation(180) s2 = spira.SRef(c1, midpoint=(0, 0), transformation=T) elems += s2 # port1 = s1.ports['RES_e3'] # port2 = s2.ports['RES_e3'] # print(port1) # print(port2) # R = spira.Route( # port1=s1.ports['RES_e3'], # port2=s2.ports['RES_e3'], # ps_layer=RDD.PLAYER.RES # ) # elems += spira.SRef(R) return elems
def create_t1(self): T = spira.Rotation(rotation=-30) ply = spira.Rectangle(p1=(0, 0), p2=(10, 50), layer=spira.Layer(number=2)) ply.transform(T) return ply
def create_t1(self): T = spira.Rotation(30) + spira.Translation(Coord(10, 0)) ply = spira.Rectangle(p1=(0, 0), p2=(10, 50), layer=spira.Layer(number=2)) ply.transform(transformation=T) return ply
def create_t1(self): cell = spira.Cell() cell += spira.Rectangle(p1=(0, 0), p2=(10, 50), layer=spira.Layer(number=2)) T = spira.Rotation(-30) S = spira.SRef(cell, transformation=T) return S
def create_elements(self, elems): elems += self.ref_point pc = ProcessLayer() T = spira.Rotation(0) S = spira.SRef(pc, midpoint=(10, 0), transformation=T) p1 = self.get_ports()[0] S.connect(port=S.ports[0], destination=p1) elems += S return elems
def create_edge(self): dw = self.port.width dl = self.port.length / 10 layer = PLayer(process=self.port.process, purpose=self.port.purpose) p = spira.Box(width=dw, height=dl, layer=layer) # T = transformation_from_vector(self.port) + spira.Rotation(-90) T = transformation_from_vector(self.port) + spira.Rotation( rotation=-90, rotation_center=self.port.midpoint) p.transform(T) return p
def create_elements(self, elems): D1 = ThroughSiliconVia() D2 = ThroughSiliconVia() s1 = spira.SRef(reference=D1) s2 = spira.SRef(reference=D1, transformation=spira.Rotation(90)) s1.connect(port='Al:T1', destination=s2.ports['Al:T2']) elems += s1 elems += s2 return elems
def create_elements(self, elems): group = spira.Group() # group += spira.Rectangle(p1=(0,0), p2=(10,10), layer=spira.Layer(1)) # group += spira.Rectangle(p1=(0,15), p2=(10,30), layer=spira.Layer(1)) group += spira.Rectangle(p1=(0,0), p2=(10,10), layer=spira.RDD.PLAYER.M1.METAL) group += spira.Rectangle(p1=(0,15), p2=(10,30), layer=spira.RDD.PLAYER.M1.METAL) group.transform(spira.Rotation(-45)) elems += group bbox_shape = group.bbox_info.bounding_box(margin=1) # elems += spira.Polygon(shape=bbox_shape, layer=spira.Layer(2)) elems += spira.Polygon(shape=bbox_shape, layer=spira.RDD.PLAYER.M2.METAL) return elems
def get_transforms(self): # T = spira.Translation(Coord(10, 0)) + spira.Rotation(rotation=60) T = spira.Translation(Coord(10, 0)) T += spira.Rotation(rotation=20) return T
import spira.all as spira class GroupExample(spira.Cell): group_transform = spira.TransformationParameter( doc='Transform parameter for a group of elements.') def create_elements(self, elems): group = spira.Group() group += spira.Rectangle(p1=(0, 0), p2=(10, 10), layer=spira.Layer(1)) group += spira.Rectangle(p1=(0, 15), p2=(10, 30), layer=spira.Layer(1)) group.transform(self.group_transform) elems += group bbox_shape = group.bbox_info.bounding_box(margin=1) elems += spira.Polygon(shape=bbox_shape, layer=spira.Layer(2)) return elems # D = GroupExample() D = GroupExample(group_transform=spira.Rotation(45)) D.gdsii_view()
import spira.all as spira R = spira.Rotation(30) T = spira.Translation((30, 0)) F = spira.Reflection(True) G0 = R + T + F G1 = spira.GenericTransform(translation=spira.Coord(-10, 0), rotation=45) G2 = spira.GenericTransform(translation=spira.Coord(-10, 0), rotation=45, reflection=True) G3 = spira.GenericTransform() G3 += R G3 += T G3 += F print(R) print(type(R)) print('') print(T) print(type(T)) print('') print(F) print(type(F)) print('') print(G0) print(type(G0)) print('')
def get_transforms(self): t1 = spira.Translation((0,0)) t2 = spira.Translation((0, -40)) + spira.Rotation(180) return (t1, t2)