I may be misunderstanding (and I’ve never tried implementing it myself), but isn’t @calmh 's Arigi what you’re looking for?
https://arigi.kastelo.net