The problem of generating a smooth reference path, given a finite family of discrete, locally optimal paths, is investigated. A finite discretization of the environment results in a sequence of obstacle-free square cells. The generated path must lie inside the channel generated by these obstacle-free cells, while minimizing certain performance criteria. Two constrained optimization problems are formulated and solved subject to the given geometric (linear) constraints and boundary conditions in order to generate a library of B-spline path templates offline. These templates are recalled during implementation and are merged together on the fly in order to construct a smooth and feasible reference path to be followed by a closed-loop tracking controller. Combined with a discrete path planner, the proposed algorithm provides a complete solution to the obstacle-free path-generation problem for an unmanned aerial vehicle in a computationally efficient manner, which is suitable for real-time implementation. Nomenclature bu = two-dimensional B-spline curve parameterized by the knot u b j = jth control points of two-dimensional B-spline curve c i;j = cell at i; j location e L , e R = left and right bounding envelopes of a twodimensional B-spline curve h = cell size H k = convex hull of S k and S k1 J ·; · = cost function L·; · = linear interpolation operator l k L , l k R = kth line segments of the left and right bounding envelopes n t L , n t R = number of concave corner points of t L and t R N d j u = B-spline basis function of degree d Pu, Qv = two-dimensional B-spline curves to be merged P i , Q i = control points of Pu and Qv Rw = merged two-dimensional B-spline curve parameterized by the knot w S k = axis-aligned bounding box at the kth Greville abscissa t L , t R = left and right channel polygons fu k g = nondecreasing knot sequence u k L , u k R = feature points obtained by intersecting two consecutive convex hulls u = Greville abscissa v k i = line segments connecting the corners of S k and S k1 i 1; : : : ; 4 w m = merging knot α = weight constant δ i = perturbation from the control points of Q i ϵ i = perturbation from the control points of P i κ = curvature of the curve ψ = tangent direction