How to fill surface with interpolated values?
4 views (last 30 days)
Show older comments
Hi,
I'm working on a mesh, resulting from an stl file . I extracted the mesh with gridtrimesh.m
This is the mesh plotted over the stl object:

As you cas see, there are some holes (for instance, the one in the red rectangle).
How can I fill the holes?
I tried with interp2, but it seems that it can't "go" beyond the surface borders.
Do you have any suggestion?
Thank you in advance for any replies.
0 Comments
Accepted Answer
More Answers (1)
the cyclist
on 19 Jun 2022
Edited: the cyclist
on 19 Jun 2022
Your code does not seem to have a call to interp2, so I'm not sure what might have gone wrong there.
If you did not specify an extrapolation method explicitly, then the implicit method that MATLAB uses may have filled in NaN, depending on the interpolation method. For example, linear interpolation will fill NaN in the extrapolation region, if you do not specify the extrapolation method.
8 Comments
Image Analyst
on 21 Jun 2022
scatteredInterpolant will only get you the top surface. It will not curl under and give you the bottom surface. However, if that's okay, you can use it but you should find those spurious spikes and filter them out so you just have valid data.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!