Help with scatteredInterpolant: masking and meshgrid alternatives

1 回表示 (過去 30 日間)
Brian
Brian 2014 年 11 月 25 日
コメント済み: David Young 2014 年 11 月 26 日
Hello, thanks for reading this,
I am asking about ways to view a 3D point cloud as surfaces. This is a follow up to an earlier question: what I have is a 4 column text file denoting a point cloud with one column denoting data that I use for color, and three column entries for x y and z coordinates.
Here is the code I used, to get an idea:
What I do right now (after looking online) is use scattered interpolation and apply the interpolation to a meshgrid, but there are problems with this approach. The problem is I am transitioning an irregular point cloud to a uniform mesh grid which I then surf to visualize. So, that being said, I can view a slice of the volume I have nicely, but the interpolation doesn't end at the boundaries of the volume: it goes to each end of the meshgrid I assign it to.
I was wondering: how can I create a similar meshgrid, but assign the surrounding region such that it isn't included when interpolating color? I think the problem arises when I try to create a meshgrid out of the interpolated data in line 23 of my code, and I think I can edit my code here to judge where to place NaN or actual data values, but I was wondering how I could do that properly.
I will attach a picture denoting what I mean as well.
Thanks for your advice.

回答 (1 件)

David Young
David Young 2014 年 11 月 25 日
A quick thought - would it help to switch off extrapolation? Use
F = scatteredInterpolant(X,Y,Z,C,'nearest','none');
  2 件のコメント
Brian
Brian 2014 年 11 月 26 日
This worked perfectly, thanks!
David Young
David Young 2014 年 11 月 26 日
Oh good! You could accept the answer - flags up that it might be generally useful.

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

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by