// Copyright (C) Svetlin Tassev; GPL-3.0-or-later. See ../LICENSE.
// Verbatim sampling fragment from CrochetPARADE index.html, lines 5655-5668.
                        const curvePoints = calculateCurvePoints();
                        const interpolateY = createInterpolationFunction(curvePoints);
                        const lengths = calculateCurveLengths(curvePoints);
                        const totalLength = lengths[lengths.length - 1];

                        const numberOfSamples = Math.round(numStitches * totalLength);
                        const deltaL = totalLength / numberOfSamples;
                        shape_radius = [];
                        for (let i = 0; i <= numberOfSamples; i++) {
                            const l_i = i * deltaL;
                            const interpolatedY = interpolateY(l_i);
                            console.log(l_i, interpolatedY * numStitches);
                            shape_radius.push(interpolatedY * numStitches);
                        }
