Interpolation on a triangle mesh in 3-space.
Mostrar comentarios más antiguos
I have imported a 3D model geometry from another software. The geometry data consists of vertices ("X"), face normals, and polygon vertex indices ("Poly"). The model is a closed surface roughly spherical. I used the vertex data and the polygon index data to construct a triangular surface plot.
I addition to this surface there are also measurements of peak-to-peak voltage at points on the surface though not necessarily at vertices (positions given by sx,sy,sz). I would like to interpolate the voltage data to all the vertices on the surface.
trisurf(Poly, X(:,1), X(:,2), X(:,3),P2P)
shading interp
axis equal
hold on
plot3(sx,sy,sz,'r+','MarkerSize',3);
The problem is that interp3 requires that "V" (in this case p2p voltage) is a 3D array. Since I have over 350 points of voltage data that needs to be interpolated onto over 2100 surface vertices, I quickly run out of memory. Even if I had enough memory I am not sure that interp3 will even give me the results I need. Griddata3 and TriScatteredInterp will not interpolate data outside of the convex hull of the data.
I temporarily mapped the p2p voltage data to the vertices of the surface closest to the point of measurement. However, this is a pretty sloppy approximation.
dtx = DelaunayTri(X);
[PI D] = nearestNeighbor(dtx,sx,sy,sz);
P2P = zeros(length(X),1);
for i=1:size(PI)
P2P(PI(i)) = p2p(i);
end
Is there a way to interpolate data onto a closed surface in 3-space?
3 comentarios
Anton Semechko
el 27 de En. de 2012
If your surface is indeed topologically equivalent and geometrically similar to a sphere, here is what you can try:
1) Embed your surface into the unit sphere using conformal mapping. You can use this function:
http://www.mathworks.com/matlabcentral/fileexchange/33785-spherical-parametrization
Since the surface you are dealing with is almost spherical to begin with, there shouldn't be significant area distortions.
2) Thereafter you can use Alpert transform to create a continuous representation of the scalar field on S2.
Toolbox:
http://www.mathworks.com/matlabcentral/fileexchange/29502-toolbox-alpert-transform
More info here:
http://www.mathworks.com/matlabcentral/fileexchange/29502-toolbox-alpert-transform/content/toolbox_alpert/html/content.html
3) After completing step 2, you can easily resample the field at the vertices of the mesh.
Subhosit Ray
el 28 de Jun. de 2018
I don't follow how to use this. Whole things look convoluted pretty much. Can you provide a sample code with comments what inputs go into the toolbox for interpolation and what functions to use from the toolbox. Thanks
Anton Semechko
el 28 de Jun. de 2018
Editada: Anton Semechko
el 28 de Jun. de 2018
Sure, can you post on here a sample dataset you want to process? Or better yet, ask your question in a new thread (and also include sample data).
Respuestas (1)
farfyy
el 27 de En. de 2012
0 votos
Hi I have exactly the same problem as you. I am starting investigation off the spline toolbox. Let me know if you find some solution
Best regards
Problem description: I want to interpolate ( extrapolate) amplitude values sampled at some vertices position on a 3D surface ( head mesh) composed of triangular elements . With TriScatteredInterp I got NAN output elements because my surface vertices where i want to interpolate does not lye in the convex hull of the sampled vertices.
1 comentario
Anton Semechko
el 27 de En. de 2012
Your problem appears to be much easier than AM's. Since your samples coincide with mesh vertices, you can use barycentric coordinates to interpolate the amplitude values in between the vertices ...
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!