//	NURBS curve
var nurbsControlPoints = [];
var nurbsKnots = [];
var nurbsDegree = 3;
/*
 * "chemin" pour une forme de type noodle (line ou tube)
 */
function noodle(dots, nb_point, nb_param) {
    group.position.y = 100;

    for (var i = 0; i <= nurbsDegree; i++) {
        nurbsKnots.push(0);
    }

    var counter = 0;
    for (var i = 0, j = nb_point; i < j; i++) {
        
        if(nb_param === 3) {
            var z = dots[counter + 2];
        }
        else var z = 0;
        
        nurbsControlPoints.push(
                new THREE.Vector3(
                        dots[counter],
                        dots[counter + 1],
                        z
                        // 1 // weight of control point: higher means stronger attraction
                        )
                );
        counter = counter + nb_param;
        var knot = (i + 1) / (j - nurbsDegree);
        nurbsKnots.push(THREE.Math.clamp(knot, 0, 1));
    }
}