Find a plane that is tangent to a part of the 3D model
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tingting
el 16 de Nov. de 2021
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/802019/image.png)
3 comentarios
Respuesta aceptada
Matt J
el 16 de Nov. de 2021
Editada: Matt J
el 18 de Nov. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Calendar en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!