mesh refinement similar to MeshLab directly in Matlab?
Afficher commentaires plus anciens
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?
Réponses (3)
Aditya Patil
le 27 Mar 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
le 5 Avr 2025
Modifié(e) : Jiexian Ma
le 5 Avr 2025
0 votes
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.
Catégories
En savoir plus sur Geometry and Mesh dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!