Robot path planning optimization for welding complex joints