class Trench(Structure) :
xpos = NumberProperty(required = True)
def define_elements(self, elems):
elems += Rectangle(layer = Layer(4), center = (xpos+25,10), box_size = (2 , 20))
elems += Rectangle(layer = Layer(4), center = (xpos+17,16), box_size = (2 , 20))
elems += Rectangle(layer = Layer(4), center = (xpos+8,31), box_size = (20 , 2))
elems += Rectangle(layer = Layer(4), center = (xpos+14,23), box_size = (20 , 2))
return elems
class ArrayOfTrenchs(Structure):
xpos_1 = NumberProperty(required = True)
no_of_xpos = PositiveNumberProperty(required = True)
no_of_ypos= PositiveNumberProperty(required = True )
origin = Coord2Property(required = True)
def define_elements(self, elems):
xp = Trench( xpos = self.xpos_1 )
delta = 40
elems += ARef(reference = xp, origin = self.origin, period = (delta,delta), n_o_periods = (self.no_of_xpos, self.no_of_ypos))
return elems
A_1 = ArrayOfTrenchs(xpos_1= 10,no_of_xpos = 41, no_of_ypos = 6, origin = (15.0, 15.0))
A_1.write_gdsii("array_of_trench.gds")