Plotting a closed volume by connecting my points together
4 ビュー (過去 30 日間)
古いコメントを表示
*I have coordinates of some points and by connecting them in 3D, I want matlab gives me a closed volume, not just connecting the points together by lines. How can I do that?
This is my coding.*
x=[-2.03759998750000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,46.8795999980000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,-1.53839999775000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,46.8795999980000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,14.1450000037500,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,46.8795999980000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,-1.53839999775000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000,46.8795999980000,2.03759998750000,32.7895999970000,2.03759998750000,0.875599994500000,2.03759998750000,32.7895999970000,2.03759998750000]';
y=[-1.47299999962500,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-81.3849999943750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-89.1150000028750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-81.3849999943750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-45.8089999963750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-81.3849999943750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-89.1150000028750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500,-81.3849999943750,1.47299999962500,-35.6150000071250,1.47299999962500,-73.9650000031250,1.47299999962500,-35.6150000071250,1.47299999962500]';
z=[-61.5049999987500,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,0.0130000062499988,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,-20.4589999845000,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,0.0130000062499988,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,-40.9549999897500,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,0.0130000062499988,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,-20.4589999845000,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500,0.0130000062499988,61.5049999987500,41.0790000005000,61.5049999987500,20.5010000002500,61.5049999987500,41.0790000005000,61.5049999987500]';
F = TriScatteredInterp(x,y,z);
ti = -100:0.5:100;
[qx,qy] = meshgrid(ti,ti);
qz = F(qx,qy);
mesh(qx,qy,qz);
hold on;
plot3(x,y,z,'o');
xlabel('x')
ylabel('y')
zlabel('z')
0 件のコメント
回答 (2 件)
KSSV
2017 年 10 月 18 日
Other method is using delaunayTriangulation.
dt = delaunayTriangulation(x,y,z) ;
tetramesh(dt)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!