Hi,
Could anyone suggest the most efficient way to align two imported STL files into MATLAB?
I am trying to align the files at the origin, then use the Hausdorff Distance function to find the distance between two points.
So preferably, one file must be translated to best align/ match up with the other.
Attached is one of the codes I am using to import the stl files, find the vertices and faces. Alternate approaches would be greatly appreciated.
I have also attched 2 images from the stl files.
[F, xyz1] = stlread('MATxct.stl');
[vn] = STLVertexNormals(F,xyz1);
[F1, xyz2] = stlread('MATcad.stl');
[vn1] = STLVertexNormals(F1, xyz2);
xyz22(:,1)=xyz2(:,1)-cx2;
xyz22(:,2)=xyz2(:,2)-cy2;
xyz22(:,3)=xyz2(:,3)-cz2;
r=vrrotvec(norm1,[0, 0, 1]);
scatter3(xyz(:,1),xyz(:,2),xyz(:,3),'b')
r=vrrotvec(norm2,[0, 0, 1]);
scatter3(xyz(:,1),xyz(:,2),xyz(:,3),'b')