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.

 採用された回答

Steven Lord
Steven Lord 2017 年 11 月 20 日

0 投票

The criticalAlpha method computes that you should use an alpha slightly greater than 1 to get all the points in 'one-region'. Giving it a bit extra leeway, I chose to use 1.03:
alpha = 1.03;
shp = alphaShape(x(:), y(:), z(:), alpha);
crit = criticalAlpha(shp, 'one-region')
plot(shp)

1 件のコメント

thengineer
thengineer 2017 年 11 月 21 日
Sorry, my understanding of the meaning of the alpha value was wrong. Now that I am aware of the actual meaning, the sporadic gaps make sense given the minor radius of 1.0.

サインインしてコメントする。

その他の回答 (1 件)

John D'Errico
John D'Errico 2017 年 11 月 20 日

0 投票

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
thengineer 2017 年 11 月 21 日
Thanks for your help. Problem is resolved (see comment to other answer). The torus was just a cooked down version of my actual geometry which I would like to mesh..
John D'Errico
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 ExchangeBounding Regions についてさらに検索

製品

タグ

質問済み:

2017 年 11 月 20 日

コメント済み:

2017 年 11 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by