Find a plane that is tangent to a part of the 3D model

2 views (last 30 days)
Hello!
I have got a 3D model and I want to find a 2D plane that is tangent to the bottom of my 3D model. The bottom is made up of three sphere-like structures spliced together. I want to know how to find such a plane to make it tangent to the bottom? There should be three tangent points.
The following figure attaches my 3D model and schematic diagram
  3 Comments
Tingting
Tingting on 16 Nov 2021
Edited: Tingting on 16 Nov 2021
I had stl format. Here is my model, thank you very much!
Tingting
Tingting on 16 Nov 2021
Let me explain in detail. In my previous work, I have obtained the 3D model of the aortic root of the human body through automatic segmentation of the neural network. This plane is called the aortic annulus plane. My task is to search for this plane to obtain the aortic annulus (the circle obtained by three tangent points) diameter. Thank you for your attention!

Sign in to comment.

Accepted Answer

Matt J
Matt J on 16 Nov 2021
Edited: Matt J on 18 Nov 2021
Obtain all the mesh vertices from your stl file in V. Then, compute the facet areas and normals of the convex hull with,
k=convhull(V);
dVa=V(k(:,2),:)-V(k(:,1),:);
dVb=V(k(:,3),:)-V(k(:,1),:);
C=cross(dVa,dVb);
Areas=vecnorm(C,2,2); %facet areas
Normals=normalize(C,2,'norm'); %facet normals
From your diagram, your three spheres look to be within about 10 degrees of the direction vector d=[2 0 1]/sqrt(3), so,
d=[2 0 1]'/sqrt(3);
subset=find(acosd(abs(Normals*d))<30);
[~,i]=max(Areas(subset));
kp=k(subset(i),:);
Vp=V(kp,:); %The 3 annulus vertices
  9 Comments
Tingting
Tingting on 23 Nov 2021
Excuse me, could you please share your code here, I don't know how to show mesh vertices .
Matt J
Matt J on 23 Nov 2021
Edited: Matt J on 23 Nov 2021
I just used scatter3. You could have used tetramesh() or plot3() or anything you like.
load meshvertices
XYZ=num2cell(V,1)';
scatter3(XYZ{:},'filled','MarkerEdgeColor','none','MarkerFaceAlpha',0.1)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!