Finding lower convex hull in 3D
조회 수: 5 (최근 30일)
이전 댓글 표시
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
답변 (2개)
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
댓글 수: 0
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Bounding Regions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!