(strokes)
return lines
Convert stroke-3 format to polyline format.
Convert stroke-3 format to polyline format.
Convert stroke - 3 format to polyline format .
def strokes_to_lines(strokes):
  """Convert stroke-3 format to polyline format."""
  x = 0
  y = 0
  lines = []
  line = []
  for i in range(len(strokes)):
    if strokes[i, 2] == 1:
      x += float(strokes[i, 0])
      y += float(strokes[i, 1])
      line.append([x, y])
      lines.append(line)
      line = []
    else:
      x += float(strokes[i, 0])
      y += float(strokes[i, 1])
      line.append([x, y])
  return lines
def strokes_to_lines ( strokes ) : x = 0 y = 0 lines = [ ] line = [ ] for i in range ( len ( strokes ) ) : if strokes [ i , 2 ] == 1 : x += float ( strokes [ i , 0 ] ) y += float ( strokes [ i , 1 ] ) line . append ( [ x , y ] ) lines . append ( line ) line = [ ] else : x += float ( strokes [ i , 0 ] ) y += float ( strokes [ i , 1 ] ) line . append ( [ x , y ] ) return lines