Extract points from generated mesh

10 vues (au cours des 30 derniers jours)
Saim Ehtesham
Saim Ehtesham le 23 Nov 2022
Commenté : Walter Roberson le 23 Nov 2022
I have the follwoing code:
clear all
clc
e2 = antenna.Ellipse('Majoraxis',4,'Minoraxis',2)
mesh(e2,'MaxEdgeLength',1e-1)
This creates a mesh something like this:
Is it possible to extract the nodal points as one large vector (or any other numeric form) from here on out? I require to do some further processing with the points.
Thanks

Réponse acceptée

Walter Roberson
Walter Roberson le 23 Nov 2022
e2 = antenna.Ellipse('Majoraxis',4,'Minoraxis',2)
h = mesh(e2,'MaxEdgeLength',1e-1)
xyz = e2.Points .';
These are the points -- just the coordinates, no connection information.
tr = e2.Triangles;
This is the connection information, where each entry is a node number. Each column is a triangle. There are is an extra row of zeros for internal processing reasons.
  2 commentaires
Saim Ehtesham
Saim Ehtesham le 23 Nov 2022
Dear Walter, thanks a lot.
The output of
xyz = e2.Points .'
makes sense but the output of
tr = e2.Triangles
does not make sense. I am pasting firt few rows here, can you please explain:
781 745 764
783 747 721
741 692 762
0 0 0
Walter Roberson
Walter Roberson le 23 Nov 2022
The first triangle is xyz(781,:) joined to xyz(783,:) joined to xyz(741,:) and the 0 marks the end of the vertex list.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by