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