In this paper, a novel path planning approach is proposed to generate porous structures with internal features. The interconnected and continuous deposition path is designed to control the internal material composition in a functionally graded manner. The proposed layer-based algorithmic solutions generate a bilayer pattern of zigzag and spiral toolpath consecutively to construct heterogeneous three-dimensional (3D) objects. The proposed strategy relies on constructing Voronoi diagrams for all bounding curves in each layer to decompose the geometric domain and discretizing the associated Voronoi regions with ruling lines between the boundaries of the associated Voronoi regions. To avoid interference among ruling lines, reorientation and relaxation techniques are introduced to establish matching for continuous zigzag path planning. In addition, arc fitting is used to reduce over-deposition, allowing nonstop deposition at sharp turns. Layer-by-layer deposition progresses through consecutive layers of a ruling-line-based zigzag pattern followed by a spiral path deposition. A biarc fitting technique is employed through isovalues of ruling lines to generate G1 continuity along the spiral deposition path plan. Functionally graded material properties are then mapped based on a parametric distance-based weighting technique. The proposed approach enables elimination or minimization of over-deposition of materials, nonuniformity on printed strands and discontinuities on the toolpath, which are shortcomings of traditional zigzag-based toolpath plan in additive manufacturing (AM). In addition, it provides a practical path for printing functionally graded materials.