Translate 3D coordinates on a known surface
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Alberto Acri
am 14 Jan. 2023
Kommentiert: Matt J
am 17 Jan. 2023
Hi. I would like to know if there is a way to translate each 3D coordinate (blue dots) such that they lie on a known red surface.
Below is the code:
Nodes_XFix = load("Nodes_XFix.mat");
Nodes_XFix = Nodes_XFix.Nodes_XFix;
Faces_XFix = load("Faces_XFix.mat");
Faces_XFix = Faces_XFix.Faces_XFix;
coord_XMov = load("coord_XMov.mat");
coord_XMov = coord_XMov.coord_XMov;
figure
plot3(Nodes_XFix(:,1), Nodes_XFix(:,2), Nodes_XFix(:,3),'r.','Markersize',12)
hold on
trimesh(Faces_XFix(:,:),Nodes_XFix(:,1),Nodes_XFix(:,2),Nodes_XFix(:,3),'EdgeColor','r','Linewidth',1,'Facecolor','w')
plot3(coord_XMov(:,1), coord_XMov(:,2), coord_XMov(:,3),'b.','Markersize',12)
hold off
grid off
axis equal
xlabel('x')
ylabel('y')
zlabel('z')
view([15,50,30])
7 Kommentare
Matt J
am 15 Jan. 2023
In future, please consolidate your variables into a single .mat file, as I have done here. This reduces the amount of work needed for us to download and import all your variables.
Akzeptierte Antwort
Weitere Antworten (1)
Matt J
am 15 Jan. 2023
[~,I]=pdist2( Nodes_XFix, coord_XMov,'euc','Smallest',1)
coord_XMov = Nodes_XFix(I,:);
2 Kommentare
Siehe auch
Kategorien
Mehr zu Point Cloud Processing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!