def METHOD_NAME(self, layer):
    m = Wire(layer.name, layer.name, layer.direction, clg=None, spg=None)
    index = layer.offset
    m.clg = CenterLineGrid()
    m.clg.addCenterLine(index, layer.width[0], isLegal=True,
                        color=None if layer.color is None else layer.color[0])
    for i in range(1, len(layer.width)):
        index += (layer.width[i-1] + layer.width[i])//2 + layer.space[i-1]
        m.clg.addCenterLine(index, layer.width[i], isLegal=True,
                            color=None if layer.color is None else layer.color[i])
    i = len(layer.width) - 1
    index += (layer.width[i] + layer.width[0])//2 + layer.space[i]
    m.clg.addCenterLine(index, layer.width[0], isLegal=True,
                        color=None if layer.color is None else layer.color[0])
    m.clg.semantic()
    m.spg = EnclosureGrid(pitch=layer.stop_pitch,
                          offset=layer.stop_offset,
                          stoppoint=layer.stop_point,
                          check=True)
    setattr(self, layer.name, self.addGen(m))
    if layer.color is not None:
        self.postprocessor.register(layer.name, color_closure(layer=layer, generator=m))