import re


def pd_svg_to_points(shape_str):
    """
    Only SVG commands L, M, and Z are used
    in the *svgpath* phase diagrams JSON field
    """
    points = []
    for point in re.split(' L | M ', shape_str.lstrip('M ').rstrip(' Z')):
        points.append([
            float(coord)
            for coord in point.split(',')
        ])
    return points