mesh refinement similar to MeshLab directly in Matlab?

14 vues (au cours des 30 derniers jours)
newbie
newbie le 22 Fév 2020
Modifié(e) : Ian Jentz le 2 Oct 2020
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 (2)

Aditya Patil
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.

Ian Jentz
Ian Jentz le 2 Oct 2020
Modifié(e) : Ian Jentz le 2 Oct 2020
There is now a port of refinemesh() available for PDEModel. Like refinemesh(), it works for 2D linear triangular geometries only.
The new PDEModel compatible function is refinePDEMmesh().
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

Community Treasure Hunt

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

Start Hunting!

Translated by