Help with scatteredInterpolant: masking and meshgrid alternatives
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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 个评论
David Young
2014-11-26
Oh good! You could accept the answer - flags up that it might be generally useful.
另请参阅
类别
在 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!