![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/326822/image.png)
3D-Surface between 2 lines.
4 ビュー (過去 30 日間)
古いコメントを表示
Mammadbaghir Baghirzade
2020 年 7 月 4 日
編集済み: Mammadbaghir Baghirzade
2020 年 11 月 10 日
Hi all,
Previously with one of the Mathwork community users' (darova) suggestion we created 3D surfaces on the sphere.
Please find the script below.
Here I have 3 surfaces the one of which (green) is below the other 2 surfaces.
Now, I aim to fill the gap between the top (red) and bottom (green) surfaces by creating an additional surface (i.e. an oblique surface (a slightly tilted surface)).
To make it clearer, in the output image of the attached code one can see 2 lines between the top (red) and bottom (green) surfaces.
I aim to create a surface between those 2 lines in order to close the gap.
I've tried several ways, and also a triangulation method, however, was not successfull.
Could you please make a suggestion on this.
I appreciate the time you spend.
Regards
0 件のコメント
採用された回答
darova
2020 年 7 月 4 日
what about this?
xf = [xl2(1) xl2(5) xl1(4) xl1(5)];
yf = [yl2(1) yl2(5) yl1(4) yl1(5)];
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/326822/image.png)
3 件のコメント
darova
2020 年 7 月 5 日
see this
n = 10;
xf1 = linspace(xl2(1), xl2(5), n);
xf2 = linspace(xl1(5), xl1(4), n);
yf1 = linspace(yl2(1), yl2(5), n);
yf2 = linspace(yl1(5), yl1(4), n);
zf11 = sqrt(49 - xf1.^2 - yf1.^2);
zf12 = sqrt(47.5 - xf1.^2 - yf1.^2);
zf21 = sqrt(47.5 - xf2.^2 - yf2.^2);
zf22 = sqrt(49 - xf2.^2 - yf2.^2);
surface([xf1;xf1;xf2;xf2],...
[yf1;yf1;yf2;yf2],...
[zf11;zf12;zf21;zf22],'facecolor','g')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/327287/image.png)
その他の回答 (1 件)
Mehmed Saad
2020 年 7 月 4 日
編集済み: Mehmed Saad
2020 年 7 月 4 日
I have a layman approach for this (The dumb method)
get co-ordinates by cursor
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/326681/image.png)
export them to workspace
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/326684/image.png)
save it in a variable
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/326687/image.png)
Now access all the co-ords
apos = [cursor_info.Position];
hold on,fill3(apos(1:3:end),apos(2:3:end),apos(3:3:end),'r','EdgeColor','none')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/326693/image.png)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!