some functions to extend svg.js and general Curve algorithms