Ramer-Douglas-Peucker Algorithm (PyScript + p5*js)