Finding lower convex hull in 3D

조회 수: 4 (최근 30일)
f10w
f10w 2014년 3월 19일
편집: Bruno Luong 2018년 10월 15일
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.

답변 (2개)

Arthur Salamatin
Arthur Salamatin 2018년 10월 15일
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 2018년 10월 15일
편집: Bruno Luong 2018년 10월 15일
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

카테고리

Help CenterFile Exchange에서 Bounding Regions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by