The solution from J. Selvaggi should be implemented and can then be integrated into magpylib. https://ieeexplore.ieee.org/abstract/document/9085339