Export geometry out of model container

1 回表示 (過去 30 日間)
MarionJ
MarionJ 2018 年 4 月 19 日
コメント済み: MarionJ 2018 年 4 月 20 日

Hello

I want to export the 3D-geometry out of my model container.

I have imported a 3D-geometry from a stl-file. Now I am interested in the coordinates of the vertices. But the gd only tells me the number of cells, faces, edges and vertices. Matlab clearly has the information. There must be a possibility to extract them.

In 2D gd is a matrix not a struct and the matrix has the x-y-coordinates.

Thanks in advance for any help.

MJ

採用された回答

Ravi Kumar
Ravi Kumar 2018 年 4 月 19 日

You can get this information easily in the latest version of MATLAB, which is R2018a. The function you need to use is findNodes.

Here is a simple example with block as geometry:

model = createpde;
gm = importGeometry(model,'Block.stl')
msh  = generateMesh(model);
vertexNodes = findNodes(msh,'region','Vertex',1:gm.NumVertices);
vertexCoordinates = msh.Nodes(:,vertexNodes)
  1 件のコメント
MarionJ
MarionJ 2018 年 4 月 20 日
Thank you Kumar!!

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

その他の回答 (1 件)

Alan Weiss
Alan Weiss 2018 年 4 月 19 日

Your PDEModel object has a Mesh property that is a FEMesh object. In that object you can see the mesh nodes (what you call the vertices).

Alan Weiss

MATLAB mathematical toolbox documentation

  1 件のコメント
MarionJ
MarionJ 2018 年 4 月 19 日
I know, but I do not want the mesh nodes, only the Corners of my geometry. For example if I have two cuboids, one on top of the other, I wish to have the coordinates of the eight Corners/vertices of this geometry. In 2D the Information is in the gd Matrix. The gd Matrix has no mesh Information in it.

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

カテゴリ

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