getSegSelectorMethod = function (seg, update) {
  const { index } = seg
  let segLine = getElement('segline_' + index)
  if (!segLine) {
    const pointGripContainer = getGripContainerMethod()
    // create segline
    segLine = document.createElementNS(NS.SVG, 'path')
    assignAttributes(segLine, {
      id: 'segline_' + index,
      display: 'none',
      fill: 'none',
      stroke: '#0FF',
      'stroke-width': 2,
      style: 'pointer-events:none',
      d: 'M0,0 0,0'
    })
    pointGripContainer.append(segLine)
  }

  if (update) {
    const { prev } = seg
    if (!prev) {
      segLine.setAttribute('display', 'none')
      return segLine
    }

    const pt = getGripPtMethod(prev)
    // Set start point
    replacePathSegMethod(2, 0, [pt.x, pt.y], segLine)

    const pts = ptObjToArrMethod(seg.type, seg.item) // , true);
    for (let i = 0; i < pts.length; i += 2) {
      const point = getGripPtMethod(seg, { x: pts[i], y: pts[i + 1] })
      pts[i] = point.x
      pts[i + 1] = point.y
    }

    replacePathSegMethod(seg.type, 1, pts, segLine)
  }
  return segLine
}
@function module:path.getSegSelector
@param {Segment} seg
@param {boolean} update
@returns {SVGPathElement}