Identify some nodes near a known node
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alberto Acri
le 9 Oct 2023
Modifié(e) : Fabio Freschi
le 9 Oct 2023
Is there a way to identify the upper and lower nodes of this geometry by knowing a node?
nodes = importdata("NODES.mat");
faces = importdata("FACES.mat");
P1 = [28.9646, -21.3886, 97.3614];
P2 = [17.2506, -22.7154, 62.1242];
figure
plot3(nodes(:,1),nodes(:,2),nodes(:,3),'k.','Markersize',2);
hold on
trimesh(faces(:,:),nodes(:,1),nodes(:,2),nodes(:,3),'EdgeColor','k','Linewidth',0.1,'Facecolor','b','FaceAlpha',0.2)
plot3(P1(:,1),P1(:,2),P1(:,3),'r.','Markersize',27);
plot3(P2(:,1),P2(:,2),P2(:,3),'r.','Markersize',27);
hold off
axis equal
0 commentaires
Réponse acceptée
Fabio Freschi
le 9 Oct 2023
Modifié(e) : Fabio Freschi
le 9 Oct 2023
You can use featureEdges. You get both upper and lower nodes, but it's not difficult to distinguish them
You can also check for nodes lying on the plane, as I suggested in yhe answer to your previous question here
nodes = importdata("NODES.mat");
faces = importdata("FACES.mat");
P1 = [28.9646, -21.3886, 97.3614];
P2 = [17.2506, -22.7154, 62.1242];
figure
plot3(nodes(:,1),nodes(:,2),nodes(:,3),'k.','Markersize',2);
hold on
trimesh(faces(:,:),nodes(:,1),nodes(:,2),nodes(:,3),'EdgeColor','k','Linewidth',0.1,'Facecolor','b','FaceAlpha',1)
plot3(P1(:,1),P1(:,2),P1(:,3),'r.','Markersize',27);
plot3(P2(:,1),P2(:,2),P2(:,3),'r.','Markersize',27);
% hold off
axis equal
TR = triangulation(faces,nodes);
E = featureEdges(TR,pi/3);
P = nodes(E(:),:);
plot3(P(:,1),P(:,2),P(:,3),'ro','MarkerFaceColor','r')
0 commentaires
Plus de réponses (1)
Matt J
le 9 Oct 2023
Modifié(e) : Matt J
le 9 Oct 2023
It can help. The outliers in d below near correspond to the faces at the caps of the tube. Once you have these faces, you can use TR.ConnectivityList to determine the vertices attached to them.
nodes = importdata("NODES.mat");
faces = importdata("FACES.mat");
P1 = [28.9646, -21.3886, 97.3614];
P2 = [17.2506, -22.7154, 62.1242];
TR=triangulation(faces,nodes);
u=(P1-P2)/norm(P1-P2);
d=faceNormal(TR)*u(:);
plot(d,'x')
0 commentaires
Voir également
Catégories
En savoir plus sur Graphics Object Programming dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!