Using generateMesh to refine a triangulation, without losing boundary points

조회 수: 18 (최근 30일)
Zel Hurewitz
Zel Hurewitz 2023년 4월 18일
답변: Samyuktha 2023년 5월 24일
I'm trying to refine a constrained Delaunay triangulation mesh automatically along the lines of Chew's algorithm. I was hoping to use MATLAB's generateMesh function, which does a nice job refining the mesh -- except that the mesh boundaries are not respected. Is there a way of forcing the generateMesh function to preserve the edge bounds?
In the example below, I have a smooth curve whose shape is distorted by generateMesh. It's not horrible in this case, but this is just an toy model for coastline polygons, where it's important to not lose any of the shape.
N= 100;
t= (1:N)/N*2*pi;
X= 1*cos(t)+ .15*cos(3*t)+ .1*sin(5*t);
X= X/range(X)*.9;
X= X- min(X) -.1;
Y= 1*sin(t)+ .5*cos(4*t)+ .4*sin(6*t);
Y= Y/range(Y)*.8;
Y= Y-min(Y)+.1;
% Create polyshape
P= polyshape(X,Y);
% Constrained triangulation of the polyshape
TRI= triangulation(P);
% Create mesh from original triangulation
model= createpde;
geometryFromMesh(model,TRI.Points',TRI.ConnectivityList');
figure(1)
tiledlayout('flow')
nexttile
plot(P)
title('Polyshape')
nexttile
pdemesh(model)
axis normal
title('Original Triangulation')
% Refine mesh
generateMesh(model,'Hmax',.3);
nexttile
pdemesh(model)
title('Distorted Shape')

답변 (1개)

Samyuktha
Samyuktha 2023년 5월 24일
Hi Zel,
I understand that you wish to use the 'generateMesh' function to preserve the edge bounds.
Please refer to 'Refine Mesh on Specified Edges and Vertices' in the 'Examples' section of the documentation generateMesh, in order to generate a 2-D mesh with finer spots around the specified edges and vertices.
Hope it helps!

카테고리

Help CenterFile Exchange에서 Triangulation Representation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by