.points[i][2], patch.points[i][3], u));
            }
            return evaluateCubicBezierCurve(tempPoints[0], tempPoints[1], tempPoints[2], tempPoints[3], v);
        }

        const globalPatchColors = [ 
            { point: 'rgba(16, 185, 129, 0.9)', grid: 'rgba(110, 231, 183,0.7)', surface: 'rgba(5, 150, 105, 0.7)' },
            { point: 'rgba(239, 68, 68, 0.9)', grid: 'rgba(252, 165, 165,0.7)', surface: 'rgba(220, 38, 38, 0.7)' },
            { point: 'rgba(139, 92, 246, 0.9)', grid: 'rgba(196, 18