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

7 次查看(过去 30 天)
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?

采纳的回答

Mathieu NOE
Mathieu NOE 2024-4-18
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 个评论
Mathieu NOE
Mathieu NOE 2024-4-19
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by