Remeshing points on curved line
이전 댓글 표시
Hello,
I have the arclength coordinates S1, S2, S3 ... SN of N = 551 points along a curved line.
I would like to now "squeeze" in 6,001 points (without increasing the total length) and determine the new arclength coordinates S1, S2, S3 ... SM (M = 6,001).
I don't want to consider the obvious solution of dividing up the total length evenly unless I have to. Rather, I ideally want to keep as many of the original points fixed as possible.
Thank you!
댓글 수: 3
the cyclist
2013년 3월 20일
You need to supply several more details.
I am not sure I understand what an "arclength coordinate" is. What does each Sn look like? Is it a single value, or a vector of values? How are they stored?
For "S1.5" that is between S1 and S2, how do you want to determine the value of S1.5? Linear interpolation? Exact formula?
Are your Sn's equally spaced? If not, do you want more points where there are bigger gaps, or not?
Rene
2013년 3월 20일
Wouter
2013년 3월 20일
In that case you could just use interp1 I guess.
채택된 답변
추가 답변 (1개)
If it is a straight line with evenly spaced points you could do this:
S % original S; % Nx2 matrix
from_value = S(1); % first point, assuming S is sorted
to_value = S(end); % last point
new_S = [linspace(from_value,to_value,length(S)+6001)]; % new S is 6001 points larger
However if the S is a curve, it is a bit more difficult; you would need to fit a polygon or a spline which decribes your current curve and then resample it using 6001 more points.
카테고리
도움말 센터 및 File Exchange에서 Interpolation of 2-D Selections in 3-D Grids에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!