Finding lower convex hull in 3D
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi everybody,
Using the convhull function, one can find the convex hull of a set of 3D points (X,Y,Z):
K = convhull(X,Y,Z);
For my problem I need to extract the lower convex hull. Could anybody please suggest me a way to do so? I found many references/code for 2D case but for 3D it seems to be not very popular :(
Thank you in advance for your help.
0 Commenti
Risposte (2)
Arthur Salamatin
il 15 Ott 2018
When I solve such type of problem, I add "lid points" in advance. They are added above the set with values like 1+max(set of points). Then, every line (or in your case triangle), containing these points is removed
0 Commenti
Bruno Luong
il 15 Ott 2018
Modificato: Bruno Luong
il 15 Ott 2018
You can select the lower part by calculate the z-component of the normal
[X,Y,Z] = sphere(50);
XYZ = [X(:) Y(:) Z(:)];
K = convhull(XYZ);
T = reshape(XYZ(K,:),[size(K) 3]);
E = diff(T,1,2);
N = cross(E(:,1,:),E(:,2,:),3);
keep = N(:,:,3)<=0;
K = K(keep,:);
T = reshape(XYZ(K,:),[size(K) 3]);
XH = T(:,:,1).';
YH = T(:,:,2).';
ZH = T(:,:,3).';
X=XYZ(:,1);
Y=XYZ(:,2);
Z=XYZ(:,3);
close all
plot3(X,Y,Z,'Color',0.8*[1 1 1],'marker','.');
hold on
fill3(XH,YH,ZH,ZH);
axis equal
0 Commenti
Vedere anche
Categorie
Scopri di più su Bounding Regions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!