This study suggests an improved chaos sparrow search algorithm to overcome the problems of slow convergence speed and trapping in local optima in UAV 3D complex environment path planning. First, the quality of the initial solutions is improved by using a piecewise chaotic mapping during the population initialization phase. Secondly, a nonlinear dynamic weighting factor is introduced to optimize the update equation of producers, reducing the algorithm's reliance on producer positions and balancing its global and local exploration capabilities. In the meantime, an enhanced sine cosine algorithm ...