Get boundary of 2d mesh

6 次查看(过去 30 天)
Aref Hemati
Aref Hemati 2018-8-23
i have a 3d mesh, i delete z axes and so i'll have 2d mesh. my question is how can i get boundary of the 2d mesh?
  1 个评论
Rik
Rik 2018-8-23
What form of data is your mesh in? You might be able to use something like inpoly.

请先登录,再进行评论。

回答(2 个)

KSSV
KSSV 2018-8-24
Read about boundary function.
%%Structured data
[X,Y,Z] = peaks(100) ;
idx = boundary(X(:),Y(:)) ;
figure
plot(X,Y,'.r') ;
hold on
plot(X(idx),Y(idx),'.-b')
%%Unstructured data
x = rand(100,1) ; y = rand(100,1) ;
idx = boundary(x,y) ;
figure
plot(x,y,'.r')
hold on
plot(x(idx),y(idx),'.-b')

Aref Hemati
Aref Hemati 2018-8-24
thanks kssv, I tried to use boundry function but as you see in below image, it's not cover all points in boundry, especially around red region sign (I zoom in on area). Even though i used 1 as shrink factor.
k = boundary(xpoints,ypoints,1);
  1 个评论
Image Analyst
Image Analyst 2018-8-24
Try different shrink factors. Attach your 2-D data if you need more help.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by