Eventually I found a solution on FileExchange: the "surf2stl" function from "Bill McDonald" generates a triangular mesh from a meshgrid that can than be reimported with "stlread". Perhaps not the most elegant solution but it is doing the trick.
How can I obtain a triangular surface mesh from a surface plot?
3 views (last 30 days)
Show older comments
Hi everyone,
I was wondering if someone knows how to solve this problem. I would like to get a triangulation of a surface plot, that is generated by revolution of a profile curve, using the cylinder function, such as:
t = 0:pi/10:2*pi;
figure
[X,Y,Z] = cylinder(2+cos(t));
surf(X,Y,Z)
axis square
Specifically I would like to obtain a surface triangulation (composed of faces and vertices) on which I can then calculate the surface curvature. For instance using the curvature estimation function from "Itzik Ben Shabat":
https://www.mathworks.com/matlabcentral/fileexchange/47134-curvature-estimationl-on-triangle-mesh
I already tried searching for solutions in the forum but with little success.
It would be great if some of you has an answer to this or could point me in the right direction.
Cheers,
Sebastian
Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!