def _gen_U(self, layerNum, objID): """For a given layerNum and objID, compute the quantity: ```latex U_{n,i}(t) = (\cup_{m<n;j} G_{m,j}) \cup (\cup_{k} A_k), ``` where the inner union terms are not included if their intersection with B_i is empty. """ layers = self.lithoDict['layers'] B = layers[layerNum]['objIDs'][objID][ 'B'] # B prism for this layer & objID GList = [] for m in layers.keys(): if m < layerNum: # then this is a lower layer for j in layers[m].keys(): if 'G' not in layers[layerNum]['objIDs'][objID]: self._gen_G(m, j) G = layers[layerNum]['objIDs'][objID]['G'] if checkOverlap([B, G]): GList.append(G) AList = [] for A in self.lithoDict['substrate'][()]: if checkOverlap([B, A]): AList.append(A) unionList = GList + AList unionObj = genUnion(unionList, consumeInputs=False) return unionObj
def _screened_H_union_list(self, obj, m, j, offsetTuple, checkOffsetTuple): """Foremd the "screened union list" of obj with the layer m, objID j H object that has been offset according to offsetTuple. The screened union list is defined by checking first whether the object intersects with the components of the checkOffset version of the H object. Then, for each component that would intersect, we return the a list of the offsetTuple version of the object. """ # First, we need to check to see if we need to compute either of the # underlying H obj lists: HDict = self.lithoDict['layers'][m]['objIDs'][j]['HDict'] # HDict stores a collection of H object component lists for each (layerNum,objID) # pair. The index of this dictionary is a tuple: () indicates no # offset, while other indices indicate an offset by summing the thicknesses # from corresponding layers. if checkOffsetTuple not in HDict: # If we haven't computed this yet HDict[checkOffsetTuple] = self._H_offset( m, j, tList=list(checkOffsetTuple)) # list of H parts self.trash += HDict[checkOffsetTuple] if offsetTuple not in HDict: # If we haven't computed this yet HDict[offsetTuple] = self._H_offset( m, j, tList=list(offsetTuple)) # list of H parts self.trash += HDict[offsetTuple] HObjCheckList = HDict[checkOffsetTuple] HObjList = HDict[offsetTuple] returnList = [] for i, HObjPart in enumerate(HObjCheckList): if checkOverlap([obj, HObjPart]): # if we need to include an overlap returnList.append(HObjList[i]) return returnList
def _screened_A_UnionList(self, obj, t, ti, offsetTuple, checkOffsetTuple): """Foremd the "screened union list" of obj with the substrate A that has been offset according to offsetTuple. """ # First, we need to see if we have built the objects before: if checkOffsetTuple not in self.lithoDict['substrate']: self.lithoDict['substrate'][checkOffsetTuple] = [] for A in self.lithoDict['substrate'][()]: AObj = self._gen_offset(A, t) self.trash.append(AObj) self.lithoDict['substrate'][checkOffsetTuple].append(AObj) if offsetTuple not in self.lithoDict['substrate']: self.lithoDict['substrate'][offsetTuple] = [] for A in self.lithoDict['substrate'][()]: AObj = self._gen_offset(A, t + ti) self.trash.append(AObj) self.lithoDict['substrate'][offsetTuple].append(AObj) returnList = [] for i, ACheck in enumerate( self.lithoDict['substrate'][checkOffsetTuple]): if checkOverlap([obj, ACheck]): returnList.append(self.lithoDict['substrate'][offsetTuple][i]) return returnList