Remove lines of specified length from triangulation

3 ビュー (過去 30 日間)
Andrew Sol
Andrew Sol 2023 年 1 月 23 日
コメント済み: Andrew Sol 2023 年 1 月 24 日
The following code generates square:
[X,Y]=meshgrid(0:0.5:1);
points=[X(:),Y(:)];
figure('Name','Point set','NumberTitle','off')
scatter(points(:,1),points(:,2),'marker','o','MarkerEdgeColor',[0 0 1],'LineWidth',2)
xlabel('x','FontSize',13);
ylabel('y','FontSize',13);
title('Point set','FontSize',13)
axis square
Then I triangulate these points:
DT=delaunay(points);
figure('Name','Trangulation','NumberTitle','off')
patch('Faces',DT,'Vertices',points,'FaceColor',[1 0.5 0],'EdgeColor',[0 0 1]);
xlabel('x','FontSize',13);
ylabel('y','FontSize',13);
title('Trangulation','FontSize',13)
Triangulation generates diagonal lines that depend on the width and height of the square grid element.
I need to remove these lines and leave the rest. And in general, I would like to understand the principle of how to remove from the triangulation lines that exceed or vice versa are less than some given value.
I was inspired by this code, but whole simplices are removed, and I need to remove only lines:
  3 件のコメント
Andrew Sol
Andrew Sol 2023 年 1 月 23 日
@KSSV I have a set of points (two dimensional figure). I want to build a mesh and then an outer (common for the shape) and an inner boundary (cavity-interiors). Boundaries must be strictly vertical and horizontal. When triangulating, diagonal lines appear. We can remove them according to the criterion of a suitable length.
Since the grid is rectangular, the length of the triangulation line should not exceed the length of the diagonal passing through a single rectangular element of the grid. I was able to do this with https://www.mathworks.com/help/images/ref/bwboundaries.html
I want to compare it with boundaries. obtained through work with a triangulation mesh.
Andrew Sol
Andrew Sol 2023 年 1 月 24 日
@KSSV In other words, I want to try building outer and inner boundaries using triangulation.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeTriangulation Representation についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by