Blend two bezier curve using partition of unity property while ensuring interpolation
조회 수: 2 (최근 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?
댓글 수: 0
채택된 답변
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
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
Mathieu NOE
2024년 4월 19일
seems to me your initial problem description is corresponding to my first comment above
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Splines에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!