(ctx, patch, currentLevel, targetMaxLevel, quad_x, quad_y) {
                if (currentLevel === targetMaxLevel) {
                    const colorIndex = (quad_x + 2 * quad_y) % globalPatchColors.length;
                    const colorScheme = globalPatchColors[colorIndex];
                    
                    // Extract 12 outer control points
                    const p = patch.points;
                    const P00=p[0][0], P01=p[0][1], P02=p[0][2], P03=p[0][3];
                    const P13=p[1][3],