code: def _generate_symbol(path, width, height, command='C'):
      
      if len(path) == 0:
          return
  
      # Initial point.
      yield 'M'
      yield path[0].anchor[1] * width
      yield path[0].anchor[0] * height
      yield command
  
      # Closed path or open path
      points = (zip(path, path[1:] + path[0:1]) if path.is_closed()
                else zip(path, path[1:]))
  
      # Rest of the points.
      for p1, p2 in points:
          yield p1.leaving[1] * width
          yield p1.leaving[0] * height
          yield p2.preceding[1] * width
          yield p2.preceding[0] * height
          yield p2.anchor[1] * width
          yield p2.anchor[0] * height
  
      if path.is_closed():
          yield 'Z'
docs: Sequence generator for SVG path.