Here is another try at the problem, which I think is a much better attempt.
Given the two cross-sections C_1
, C_2
Place each C_i
into a global reference frame with coordinate system (x,y)
so that the way they are relatively situated makes sense. Split each C_i
into an upper and lower curve U_i
and L_i
. The idea is going to be that you will want to continuously deform curve U_1
to U_2
and L_1
to L_2
. (Note you can extend this method to split each C_i
into m
curves if you wish.)
The way to do this is as follows. For each T_i = U_i, or L_i
sample n
points, and determine the interpolating polynomial P{T_i}(x)
. As some one duly noted below, interpolating polynomials are susceptible to oscillation especially at the endpoints. Instead of the interpolating polynomial, one may instead use the least squares fit polynomial which would be much more robust. Then define the deformation of the polynomial P{U_1}(x) = a_0 + a_1 * x + ... + a_n * x^n
to P{U_2}(x) = b_0 + b_1 * x + ... + b_n * x^n
as Q{P{U_1},P{U_2}}(x, t) = ( t * a_0 + (1 - t ) b_0 ) + ... + (t * a_n + (1-t) * b_n ) * x^n
where the deformation Q
is defined over 0<=t<=1
where t
defines at which point the deformation is at (i.e. at t=0
we are at U_2
and at t=1
we are at U_1
and at every other t
we are at some continuous deformation of the two.)
The exact same follows for Q{P{L_1},P{L_2}}(x, t)
. These two deformations construct you a continuous representation between the two cross-sections which you can sample at any t
.
Note all this is really doing is linearly interpolation the coefficients of the interpolation polynomials of the two pieces of both cross-sections. Note also when spliting the cross-sections you should probably put the constraint that they must be split at end points that match up otherwise you may have "holes" in your deformation.
I hope thats clear.
edit: addressed the issue of oscillation in interpolating polynomials.