Can you verify if the following method works. The basic idea is, as you loop around the inner nodes, you get the nearest from the outer one and add an edge. The nearest on the outer loop should be either the one already set, or one of its neighbours. So you can exploit this, like so:
innernode = firstnode(innerloop)
outernode = NULL
while(innernode) do
if(outernode) then
//For every new node, check if the outer node is the nearest,
//or if any of its neighbours are
newouternode = find_nearest_among(outernode, prev(outernode),
next(outernode), innernode)
if(newouternode != outernode) then
//If we found a new node, add an extra edge,
//otherwise, we'll have quads
//The figure shows why this is needed.
make_edge(innernode, outernode)
outernode = newouternode
end
else
//the first time, find the closest node in the outer loop)
outernode = find_nearest(outerloop, innernode)
end
//continue making an edge to the outernode, we're closest to
make_edge(innernode, outernode)
//move on
innernode = next(innernode)
end