code: def boundingPolygon(self, debug):
      w = self.width * 1.5
      w = min(w, 2)
      s, e = self.line().p1(), self.line().p2()
      dir = s - e
      dx, dy = -dir.y(), dir.x()
      norm = (dx**2 + dy**2) ** (1 / 2)
      if debug:
          print(
              self.width,
              w,
              s.x(),
              s.y(),
              e.x(),
              e.y(),
              dir.x(),
              dir.y(),
              dx,
              dy,
              norm,
          )
      dx /= norm + 1e-16
      dy /= norm + 1e-16
      if debug:
          print("dir", dx, dy)
      p = QtCore.QPointF(dx * w, dy * w)
      poly = QtGui.QPolygonF([s - p, s + p, e + p, e - p])
      return poly
  
file_path: PaddleSeg/EISeg/eiseg/widget/line.py
imports: from qtpy import QtWidgets, QtGui, QtCore
label_desc: Use image node_id 10 for calling the LineItem obj's underlying member method code with example usage: obj.boundingPolygon(debug) and returns: poly