Finding lower convex hull in 3D

4 views (last 30 days)
f10w
f10w on 19 Mar 2014
Edited: Bruno Luong on 15 Oct 2018
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.

Answers (2)

Arthur Salamatin
Arthur Salamatin on 15 Oct 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

Bruno Luong
Bruno Luong on 15 Oct 2018
Edited: Bruno Luong on 15 Oct 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

Categories

Find more on Bounding Regions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!