title: Draw a second identical polygon inside a primary one with a certain gap
body: <p>The code below sketches a polygon on an image. I would like to draw a second identical shape inside the primary one with a gap of 0.3m. I have tried a couple of solutions but none of them worked in all use cases.</p>
  <p>Please refer to the attached screenshot.</p>
  <p><img src="https://i.stack.imgur.com/fTl9H.png" alt="image" /></p>
  <p>Context: The shape is drawn by combining a group of selected points using the QPolygon class.</p>
  <pre><code>import sys
  from sympy import Polygon
  from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout
  from PyQt5.QtCore import QLine, Qt, QPoint, QRect
  from PyQt5.QtGui import QPixmap, QPainter,QColor,QPolygon
  from PyQt5 import QtCore, QtGui, QtWidgets, uic
  
  
  
  
  
  class MyApp(QWidget):
      
      def __init__(self):
          super().__init__()
          self.window_width, self.window_height =1200,800
          self.setMinimumSize(self.window_width,self.window_height)
          layout= QVBoxLayout()
          self.setLayout(layout)
  
          self.pix  = QPixmap('image.jpg')
          self.resize(self.pix.width(),self.pix.height())
          # self.pix.fill(Qt.white)
          # tableau
          self.point = QPoint()
          self.tab =[]
  
     
  
      def paintEvent(self,event):
          painter = QPainter(self)
          pen = QtGui.QPen()
          pen.setColor(QtGui.QColor('red'))
          pen.setWidth(3)
          painter.setPen(pen)
          painter.drawPixmap(QPoint(),self.pix)
        
          if not self.point.isNull():
              # rect = QRect(self.begin,self.destination)
              # painter.drawRect(rect.normalized())
              line = QPoint(self.point)
              painter.drawPoint(line)
              
  
      def mousePressEvent(self,event):
          if event.buttons() &amp; Qt.LeftButton:
              self.point = event.pos()
              # self.destination = self.begin
              
  
              
              self.update()
          
  
      # def mouseMoveEvent(self,event):
      #     if event.buttons() &amp; Qt.LeftButton:
      #         self.point = event.pos()
      #         self.update()
  
      def mouseReleaseEvent(self,event):
          pen = QtGui.QPen()
          painter = QPainter(self.pix)
          if event.button() == Qt.LeftButton:
              # rect = QRect(self.begin,self.destination)
              line = QPoint(self.point)
              pen.setColor(QtGui.QColor('red'))
              pen.setWidth(3)
              painter.setPen(pen)
              painter.drawPoint(line)
              painter.setPen(QColor(168, 34, 3))
              
              self.tab.append(self.point)
              print(self.point.x,self.point.y)
              
              self.point = QPoint()
              # w = (rect.width()*12.5)/1056
              # h = (rect.height()*12.5/1056)
              # a=w*h
              # print(w, h,a)
              self.update()
          if event.button() == Qt.RightButton:
              points = QPolygon(self.tab)
              pen.setColor(QtGui.QColor('red'))
              painter.setPen(pen)
              painter.drawPolygon(points)
              #print(self.tab[0])
              polytab=[]
              for i in self.tab:
                  polytab.append((i.x(),i.y()))   
              print(Polygon(*polytab).area*(12.5/1056)*(12.5/1056))
              print((self.tab[0].x()-self.tab[1].x())*(12.5/1056))
              self.tab=[]
              self.update()
  
  
  
  
  if __name__ == '__main__':
      
      app = QApplication(sys.argv)
      app.setStyleSheet('''QWidget{font-size:30px}''')
      myAPP = MyApp()
      myAPP.show()
  
      try:
          sys.exit(app.exec_())
      except SystemExit:
          print('Closing Window...')
  </code></pre>