3D plotted shape is not following curvature of data points

4 ビュー (過去 30 日間)
Sumeet Chaudhari
Sumeet Chaudhari 2020 年 7 月 6 日
編集済み: John D'Errico 2020 年 7 月 6 日
I am writing a code that creates a 3D shape from a set of data points and am running into this problem where the shape does not properly follow the curvature of the data points and rather draws a straight line. This can be seen on the sides of the figure below where the shape isn't properly following the data points into the curves.
My code:
load('seg_info.mat');
x = seg_info(:, 1);
y = seg_info(:, 2);
z = seg_info(:, 3);
colors = seg_info(:, 4);
scatter3(x,y,z);
hold on;
DT = delaunayTriangulation(x, y, z);
[K, v] = convexHull(DT);
trisurf(K, DT.Points(:,1), DT.Points(:,2), DT.Points(:,3), ...
'FaceAlpha', 0.5, 'EdgeColor', 'none', ...
'CData', colors, 'FaceColor', 'interp');
Does anyone know how I can improve my code to better fit these sides? I have tried using alpha shapes and boundary in an attempt to derive the concave hull but neither worked.
  5 件のコメント
John D'Errico
John D'Errico 2020 年 7 月 6 日
You think the problem is in the triangulation? A delaunay triangulation trinagulates the entire region within the convex hull of the data. In fact, you even used a convex hull there. So surely you would expect that the result will be a convex region. If you don't want it to be convex, then you can't use a convex hull. Or for that matter, a Delaunay triangulation.
Sumeet Chaudhari
Sumeet Chaudhari 2020 年 7 月 6 日
I have been trying to use mesh and even searching File Exchange for a program that calculates a concave hull. Looking at a scatter3 plot, I wish there was a way to just connect all the dots since the input data already represents the outer surface of the shape.

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

採用された回答

jonas
jonas 2020 年 7 月 6 日
  2 件のコメント
Sumeet Chaudhari
Sumeet Chaudhari 2020 年 7 月 6 日
thank you so much for the help! really appreciate it
John D'Errico
John D'Errico 2020 年 7 月 6 日
編集済み: John D'Errico 2020 年 7 月 6 日
Assuming that is a CRUST implementation, it is probably the best choice. And a quick glance at the code suggests it is indeed CRUST.
An alternative code can be found here:

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBounding Regions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by