Lung cancer is the leading cause of cancer deaths worldwide. Although several lung cancer diagnostic methods are available for lung nodule biopsy, there are limitations in terms of accuracy, safety, and invasiveness. Transbronchial needle aspiration (TBNA) is a common method for diagnosing and treating lung cancer that involves a robot-assisted medical flexible needle moving along a curved three-dimensional trajectory, avoiding anatomical barriers to achieve clinically meaningful goals in humans. Inspired by the puncture angle between the needle tip and the vessel in venipuncture, we suggest that different orientations of the medical flexible needle puncture path affect the cost of the puncture trajectory and propose an effective puncture region based on the optimal puncture direction, which is a strategy based on imposing geometric constraints on the search space of the puncture direction, and based on this, we focused on the improved implementation of RCS*. Planning within the TBNA-based lung environment was performed using the rapidly exploring random tree (RRT), resolution-complete search (RCS), and RCS* (a resolution-optimal version of RCS) within an effective puncture region. The experimental results show that the optimal puncture direction corresponding to the lowest cost puncture trajectory is consistent among the three algorithms and RCS* is more efficient for planning. The experiments verified the feasibility and practicality of our proposed minimum puncture angle and puncture effective region and facilitated the study of the puncture direction of flexible needle puncture.