def METHOD_NAME(cls, buff, dtype, ndim):
    if not buff:
        return cls([], dtype)
    num_polygons = int.from_bytes(buff[:2], "little")
    offset = num_polygons * 2 + 2
    lengths = np.METHOD_NAME(buff[2:offset], dtype=np.uint16)
    points = np.METHOD_NAME(buff[offset:], dtype=dtype).reshape(-1, ndim)
    data = []
    for l in lengths:
        data.append(points[:l])
        points = points[l:]
    return cls(data, dtype)