Find the upper surface of a 3d object.
Afficher commentaires plus anciens
As the title suggests, I would like to find the points that correlate only to the upper surface of a 3d object.
I have a matrix containing thousands of points (x,y,z coordinates). The shape is that of a slightly bent, rectangular plate. The coordinates pertain to a molecular structure, so the volume of the structure is filled with points.
I used following to approximate the the shape and then find the outer perimeter:
mymatrix; %mymatrix(:,1) corresponds to x coordinates, mymatrix(:,2) corresponds to y, and mymatrix(:,3) corresponds to z
%The following creates a bounding volume and provides xyz coordinates of that bounding volume
shp = alsphashape(x,y,z, 0.1);
[tri, xyz] = boundaryFacets(shp);
trisurf(tri,xyz(:,1),xyz(:,2),xyz(:,3), 'FaceColor','cyan','FaceAlpha',0.3) ; %This plots that outer perimeter and also yields the xyz matrix of that bounding box
I would like to extract the points correlating only to the upper surface of this matrix so that I can then later take the gradient of that surface.
I think I'm just missing something simple here. Any help is greatly appreciated.
Réponse acceptée
Plus de réponses (1)
Matt J
le 9 Sep 2020
0 votes
Perhaps you can obtain the facet normals like in this example,
and classify any facet whose normal has a positive z-component as belonging to the upper surface.
Catégories
En savoir plus sur Vector Fields dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!