How to access to the vertices and facets of each face detected using importGeometry (PDE toolbox) ?

33 ビュー (過去 30 日間)
Using importGeometry and pdegplot (PDE toolbox),
N = 3;
model = createpde(N);
importGeometry(model,'BracketWithHole.stl');
pdegplot(model,'FaceLabels','on')
the geometry is decomposed into different faces as shown in the picture. How to access to the vertices and the facets (triangles of the mesh) of each labeled face ?

採用された回答

Gaetano Formato
Gaetano Formato 2016 年 11 月 8 日
Hello,
I was able to associate nodes to faces thanks to this answer:
https://it.mathworks.com/matlabcentral/answers/310479-how-to-assign-nodes-to-faces-of-a-3d-tetrahedral-mesh-pdetool?s_tid=srchtitle
Thank you for your time.
Gaetano
  2 件のコメント
Joep Eijsermans
Joep Eijsermans 2020 年 5 月 11 日
did you do it, and so yes can you give me an example. I dont understand it at all

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

その他の回答 (2 件)

Alan Weiss
Alan Weiss 2016 年 11 月 2 日
First you have to create the mesh:
generatemesh(model);
If you have the latest MATLAB version (R2016b), you can view the mesh nodes and element labels using pdeplot3D. Sorry, I know of no way of obtaining the labels programmatically.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 件のコメント
Sleh Eddine Brika
Sleh Eddine Brika 2016 年 11 月 2 日
Thanks for your answer, but this is not what I meant. I know the way how to get the facets and the vertices of the whole 3d object as shown here
model = createpde(1);
b=importGeometry(model,'file.stl');
g=model.Geometry;
[F, V] = g.allDisplayFaces();% V for vertices and F for the facets
[Ex, Ey, Ez] = g.allDisplayEdges();% Here we have the edges
pdegplot(model);
There is a built-in function that decompose the STL file into different faces (as shown in the picture). What I need is, for example I want to get the facets belonging to Face 4
Alan Weiss
Alan Weiss 2016 年 11 月 3 日
Sorry, I have no idea.
Alan Weiss
MATLAB mathematical toolbox documentation

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


Gaetano Formato
Gaetano Formato 2016 年 11 月 3 日
Hello,
I am facing the same problems. I would like to assign boundary nodes to faces in order to describe the solution over the faces. It seems impossible that there is no way to distinguish the boundary nodes from the face label. The geometry is imported as STL file. Thank you for your attention
Best Regards
Gaetano
  1 件のコメント
Sleh Eddine Brika
Sleh Eddine Brika 2016 年 11 月 4 日
Hello, there is a way to get all the faces edges (boundary), but we cannot know the edges of each face.
model = createpde(1);
b=importGeometry(model,'cube.stl');
g=model.Geometry;
[F, V] = g.allDisplayFaces();% V for vertices and F for the facets
[Ex, Ey, Ez] = g.allDisplayEdges();% Here we have the edges
pdegplot(model);
And if you check the length of edges matrix you will find 12 which corresponds to the edges number of a cube.

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

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by