def __createPasteAvoidViasInside(self):
        top_left_area = self.top_left_via + self.via_grid / 2
        self.inner_grid = self.via_grid / Vector2D(self.paste_between_vias)

        if any(self.paste_rings_outside):
            self.inner_size = self.via_grid / Vector2D(
                self.paste_between_vias) * self.paste_reduction
        else:
            # inner_grid = mask_size/(inner_count)
            self.inner_size = self.paste_area_size / (
                self.inner_count) * self.paste_reduction

        corner = ChamferSelPadGrid(0)
        corner.setCorners()
        pad = ChamferedPadGrid(number="",
                               type=Pad.TYPE_SMT,
                               center=[0, 0],
                               size=self.inner_size,
                               layers=['F.Paste'],
                               chamfer_size=0,
                               chamfer_selection=corner,
                               pincount=self.paste_between_vias,
                               grid=self.inner_grid,
                               radius_ratio=self.radius_ratio,
                               maximum_radius=self.maximum_radius)
        pad.chamferAvoidCircle(center=self.via_grid / 2,
                               diameter=self.via_drill,
                               clearance=self.via_clarance)

        count = [self.vias_in_mask[0] - 1, self.vias_in_mask[1] - 1]
        return ExposedPad.__createPasteGrids(original=pad,
                                             grid=self.via_grid,
                                             count=count,
                                             center=self.at)
    def __createPasteOutsideY(self):
        pads = []
        corner = ChamferSelPadGrid({
            ChamferSelPadGrid.BOTTOM_LEFT: 1,
            ChamferSelPadGrid.BOTTOM_RIGHT: 1
        })

        x = self.at[0] - (self.via_layout[0] - 2) / 2 * self.via_grid[0]
        y = self.top_left_via[1] - self.ring_size[1] / 2

        pad_side = ChamferedPadGrid(
            number="",
            type=Pad.TYPE_SMT,
            center=[x, y],
            size=[self.inner_size[0], self.outer_size[1]],
            layers=['F.Paste'],
            chamfer_size=0,
            chamfer_selection=corner,
            pincount=[self.paste_between_vias[0], self.paste_rings_outside[1]],
            grid=[self.inner_grid[0], self.outer_paste_grid[1]],
            radius_ratio=self.radius_ratio,
            maximum_radius=self.maximum_radius)

        if not self.kicad4_compatible:
            pad_side.chamferAvoidCircle(center=self.top_left_via,
                                        diameter=self.via_drill,
                                        clearance=self.via_clarance)

        pads.extend(
            ExposedPad.__createPasteGrids(original=pad_side,
                                          grid=self.via_grid,
                                          count=[self.via_layout[0] - 1, 1],
                                          center=[self.at['x'], y]))

        corner = ChamferSelPadGrid({
            ChamferSelPadGrid.TOP_LEFT: 1,
            ChamferSelPadGrid.TOP_RIGHT: 1
        })
        pad_side.chamfer_selection = corner

        y = 2 * self.at[1] - y
        pads.extend(
            ExposedPad.__createPasteGrids(original=pad_side,
                                          grid=self.via_grid,
                                          count=[self.via_layout[0] - 1, 1],
                                          center=[self.at['x'], y]))
        return pads
    def __createPasteOutsideCorners(self):
        pads = []
        left = self.top_left_via[0] - self.ring_size[0] / 2
        top = self.top_left_via[1] - self.ring_size[1] / 2
        corner = [[{
            ChamferSelPadGrid.BOTTOM_RIGHT: 1
        }, {
            ChamferSelPadGrid.TOP_RIGHT: 1
        }],
                  [{
                      ChamferSelPadGrid.BOTTOM_LEFT: 1
                  }, {
                      ChamferSelPadGrid.TOP_LEFT: 1
                  }]]
        pad_side = ChamferedPadGrid(number="",
                                    type=Pad.TYPE_SMT,
                                    center=[left, top],
                                    size=self.outer_size,
                                    layers=['F.Paste'],
                                    chamfer_size=0,
                                    chamfer_selection=0,
                                    pincount=self.paste_rings_outside,
                                    grid=self.outer_paste_grid,
                                    radius_ratio=self.radius_ratio,
                                    maximum_radius=self.maximum_radius)

        if not self.kicad4_compatible:
            pad_side.chamferAvoidCircle(center=self.top_left_via,
                                        diameter=self.via_drill,
                                        clearance=self.via_clarance)

        for idx_x in range(2):
            for idx_y in range(2):
                x = left if idx_x == 0 else 2 * self.at[0] - left
                y = top if idx_y == 0 else 2 * self.at[1] - top
                pad_side.center = Vector2D(x, y)
                pad_side.chamfer_selection = ChamferSelPadGrid(
                    corner[idx_x][idx_y])
                pads.append(copy(pad_side))

        return pads