undesired gaps in alphashape?
古いコメントを表示
I am having trouble to generate a "gap-free" alpha shape for the following example:
% surface points from: https://stackoverflow.com/questions/10655393
aminor = 1.; % Torus minor radius
Rmajor = 3.; % Torus major radius
sd = 24;
theta = linspace(-pi, pi, sd) ; % Poloidal angle
phi = linspace(0., 2.*pi, 2*sd) ; % Toroidal angle
[t, p] = meshgrid(phi, theta);
x = (Rmajor + aminor.*cos(p)) .* cos(t);
y = (Rmajor + aminor.*cos(p)) .* sin(t);
z = aminor.*sin(p);
I am creating the alpha shape with
alpha = 1;
shp = alphaShape(x(:),y(:),z(:), alpha);
plot(shp);
Here is the figure:

As you can see, alpha should be big enough to cover all distances between the desired surface points, yet the returned alpha shape contains some gaps.
What am I missing?
PS: I get identical results on Matlab R2016b and R2017b.
採用された回答
その他の回答 (1 件)
John D'Errico
2017 年 11 月 20 日
It looks like an alpha ball of radius 1 is just slightly too small. Using my own alpha shape code, written long ago, I find it works fine with an alpha ball of 1.05 radius. But when I tried a radius of 1, it all went up in smoke. The figure below is for alpha=1.05.

Personally, if all you are trying to do is make a plot, I would just create it by
surf(x,y,z)
2 件のコメント
thengineer
2017 年 11 月 21 日
John D'Errico
2017 年 11 月 21 日
When you have a problem like that with an alpha shape, it means your value of alpha is too small. The alpha probe will manage to penetrate too deeply, and the entire alpha shape can quickly disintegrate.
カテゴリ
ヘルプ センター および File Exchange で Bounding Regions についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!