Blend two bezier curve using partition of unity property while ensuring interpolation

I have two Bezier curve, say c1 and c2, these curves are interpolating the data points, while the given data points have some common points. i want to blend/merge them to a single curve while ensuring continuity and interpolation. Hower i got something like
the resulting curve is not interpolating the given data points of both c1 and c2 curves. I used weight functions as w1=1-u and w2=u.
is there any way i can get the blending curve while ensuring the interpolation of given data also?

 Accepted Answer

hello
seems to me there is a simple solution to your problem - simply combine x,y data of both curves and use unique to remove duplicate points
the final result (black curve) I added a magnifcation factor of 1.02 (to be removed) just to make the curve easier to see
here we have 6 points in common between C1 & C2
% generate some dummy C and C2 coordinates
theta = linspace(0,pi/2,20);
n = 7;
t1 = theta(1:end-n);
t2 = theta(n+1:end);
x1 = cos(t1);
y1 = sin(t1);
x2 = cos(t2);
y2 = sin(t2);
% combine both curves
x = [x1(:);x2(:)];
y = [y1(:);y2(:)];
[x,ia,ic] = unique(x);
y = y(ia);
plot(x1,y1,'bd-',x2,y2,'r*-',x*1.02,y*1.02,'k*--'); % factor *1.02 on black curve just to make vizualisation easier
axis square

3 Comments

But in the case of Bezier curves, we construct them using control points. As I am working on an interpolation problem where the data points of two adjacent segments overlap, the resulting curves also overlap when I interpolate them using Bezier. However, I am seeking a technique that can blend these two curves together while ensuring proper interpolation.
then you could use my example on the control points (if there are common control points) and then construct the resulting Bezier curve
or
interpolate the two Bezier curves and apply the same receipt
seems to me your initial problem description is corresponding to my first comment above

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Asked:

on 18 Apr 2024

Commented:

on 19 Apr 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!