blank space in alpha shape

조회 수: 1 (최근 30일)
yonatan s
yonatan s 2017년 4월 30일
댓글: John D'Errico 2017년 4월 30일
using the alphavol function i wrote the following code:
%create crater alpha shape.
clear;clc;
ddr=0.12; %depth diameter ratio
a=1/ddr/2; %semi major axis. horizontal axes are equal
n=31; %number of points for x y vectors.
x = linspace(-a,a,n);
y = linspace(-a,a,n);
[X,Y] = meshgrid(x,y);
Z =real(sqrt(1-(X.^2)/a^2-(Y.^2)/a^2))*-1+1; % the plus for Z>0
[V,S] = alphavol([X(:),Y(:),Z(:)],1,1);
trisurf(S.bnd,X,Y,Z,'FaceColor','blue','FaceAlpha',1)
xlabel('x');ylabel('y');zlabel('z');
___
as the picture shows, i get blank space in the bottom of the shape. i know i can resolve this by assigning greater values to n, but it is still only an approximation. also, i dont want to set up R=inf, because this will give a surface on the X-Y plane(where z=1).
thank you for your help
  댓글 수: 3
Image Analyst
Image Analyst 2017년 4월 30일
Do you want to fill in the hole? If so try regionfill().
John D'Errico
John D'Errico 2017년 4월 30일
Of course, if you fill in the hole, then what is the purpose of the alpha shape?
As for something being an approximation, ANYTHING you do on a computer is an approximation. The skill of working on a computer, in any discipline, be it applied mathematics, statistics, image processing, any engineering discipline, any physical science, etc., is in knowing what approximations are viable to use, and which ones will kill you.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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