codes = []
last = (0, 0)
for cmd, values in path_re.findall(path):
points = [float(v) for v in float_re.findall(values)]
points = np.array(points).reshape((len(points)//2, 2))
if cmd.islower():
points += last
After Change
// the beginning of the string).
points = ([*map(float, re.split(",|(?<!^)(?=[+-])", values))] if values
else [(0., 0.)]) // Only for "z/Z" (CLOSEPOLY).
points = np.reshape(points, (-1, 2))
if cmd.islower():
points += vertices[-1][-1]
codes.extend(commands[cmd.upper()])
vertices.append(points)
return np.array(codes), np.concatenate(vertices)