mesh refinement similar to MeshLab directly in Matlab?
Ältere Kommentare anzeigen
Is there a Mesh-Refinement function in Matlab/FEX to refine triangulated mesh data?
MeshLab has this function "Remeshing, Simplification and Reconstruction --> Refine User-Defined: Refine current mesh with user defined parameters".
This increases the number of edges in the triangulated surface pretty easy and quick.
I want to get rid of the workaround via MeshLab and do this directly in Matlab. Any ideas?
Or is there a way to access MeshLab from the Matlab code?
Antworten (3)
Aditya Patil
am 27 Mär. 2020
Currently this feature is not supported in MATLAB. It might be considered in any future release.
Following are possible workarounds:
- Use the ‘Hmax’, ‘Hmin’ and ‘Hgard’ options of generateMesh as such,
mesh_Hgrad = generateMesh(model,'Hmax',20,'Hmin',0.5,'Hgrad',1.9)
- Use the legacy [p, e, t] format and manually refine the mesh using any algorithm of your choice.
There is now a port of refinemesh() available for PDEModel. Like refinemesh(), it works for 2D linear triangular geometries only.
This is likely how would run your problem:
create your model as a pde model
model=createpde;
proceed with your geometry definitions.
When you get to meshing, you instantiate your mesh as usuall, but then can refine the mesh on a particular face using refinePDEMmesh().
generateMesh(model);
model = refinePDEMmesh(model); % this will refine all elements within the model
FaceID = 1;
model = refinePDEMmesh(model,FaceID); % this will refine only elements within Face 1
Jiexian Ma
am 5 Apr. 2025
Bearbeitet: Jiexian Ma
am 5 Apr. 2025
0 Stimmen
In newer version (R2021b), Matlab function generateMesh can do local mesh refinement.
If function generateMesh does not work for your model, you may use Im2mesh package (for 2d mesh) instead.
Example of local mesh refinement in Im2mesh package:



The mesh generated can be easily convert to Matlab PDE model object.
Kategorien
Mehr zu Geometry and Mesh finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!