Identify some nodes near a known node
1 回表示 (過去 30 日間)
古いコメントを表示
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1506159/image.png)
0 件のコメント
採用された回答
Fabio Freschi
2023 年 10 月 9 日
編集済み: Fabio Freschi
2023 年 10 月 9 日
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 件のコメント
その他の回答 (1 件)
Matt J
2023 年 10 月 9 日
編集済み: Matt J
2023 年 10 月 9 日
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1506289/image.png)
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!