A 2D slice of a 3D point cloud or see if a point is in a boundary
8 ビュー (過去 30 日間)
古いコメントを表示
So I have a Large 3D point cloud that I can turn into a Delaunay triangulation or a trisurf/mesh or put a boundary or create a boundary around. Ideally I would like 2D slices of the triangulation or boundary that I can plot. However If that is not possible I would simply like to know if a point is in the boundary created by the boundary function.
Thank you for any help :)
0 件のコメント
回答 (1 件)
John D'Errico
2018 年 2 月 25 日
編集済み: John D'Errico
2018 年 2 月 25 日
You should understand that a Delaunay triangulation will have a convex result? The outer boundary of a delaunay triangulation is the convex hull of the point set.
So if your point cloud is not convex, than the delaunay triangulation might incorrectly predict if some points are "inside"?
For example,
xy = rand(1000,2);
xy(sqrt(sum((xy - [1 .5]).^2,2)) < 0.3 ,:) = [];
plot(xy(:,1),xy(:,2),'.')
So any tool that relies on a convex hull, OR a delaunay triangulation will fail to recognize that circular indentation on the right edge of the cloud.
I did post a tool called inhull some years ago on the file exchange. But it tool will fail to recognize non-convexity.
However, if you have a moderately recent MATLAB release (R2014b or later), you could use the alphaShape utility.
S = alphaShape(xy,.25)
S =
alphaShape with properties:
Points: [859×2 double]
Alpha: 0.25
HoleThreshold: 0
RegionThreshold: 0
inShape(S,[.5 .5;.9 .5])
ans =
2×1 logical array
1
0
plot(S)
alphaShape also works in 3-dimensions.
Of course, if your data really is convex, then a simple convex hull will suffice. In that case, inhull will suffice. Or a delaunay tessellation will do what you want.
T = delaunayn(xy);
tsearchn(xy,T,[.9 .5;1.9 .5])
ans =
126
NaN
So the first point was inside, the second outside the cloud.
Computing a 2-d slice of a 3-d tessellation takes some more work, but is doable.
参考
カテゴリ
Help Center および File Exchange で Point Cloud Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!