surface from boundary curves
2 ビュー (過去 30 日間)
古いコメントを表示
Hello i have 4 boundary curves and i would like to make a surface from them do you have any tip how to do it?
And also do you have any tip if i would like to know distance and the surface betwen red and yelow curve at any point?
thank you, Dominik

2 件のコメント
Image Analyst
2021 年 8 月 13 日
Please attach your data for the 4 curves to make it easier for people to help you.
Also explain how you'd like to assign the surface for the missing z values. Do you just want to take the weighted-by-distance average of the 4 closest points (one closest point from each curve)? Or do you have some other recipe?
What sort of resolution do you have or require, like how many points between 0 and 80? Or 20 and 55?
回答 (1 件)
Image Analyst
2021 年 8 月 13 日
To find the shortest distance between the red curve and the yellow curve, try this. Adapt as needed:
% Create two curves that are a list of (x,y,z) coordinates - one point per row.
xyzRed = rand(3, 100)';
xyzYellow = rand(3, 150)';
% Now we have our data and we can begin.
numPoints = size(xyzRed, 1);
distances = zeros(numPoints, 2);
for k = 1 : numPoints
thisX = xyzRed(k, 1);
thisY = xyzRed(k, 2);
thisZ = xyzRed(k, 3);
% Get distances of this point to every other point.
allDistances = sqrt((thisX - xyzYellow(:, 1)) .^ 2 + ...
(thisY - xyzYellow(:, 2)) .^ 2 + ...
(thisZ - xyzYellow(:, 3)) .^ 2)
% Find the min distance
[minDistance, indexOfMin] = min(allDistances);
% Log the closest distance and its index.
distances(k, 1) = minDistance;
distances(k, 2) = indexOfMin;
end
You can do the converse also of course. If you want the distance of the red curve from all points in the yellow curve. They will be different distances if the red and yellow curves do not have the same number of elements.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!