How can I generate an .stl file from a symbolically generated 3D surface?

5 次查看(过去 30 天)
I used ezsurf() to generate a 3D surface of 3 parameterized equations. I'd like to export the data as an stl file, but surf2stl() does not seem to working, any suggestions?
For reference, here is the code used to generate the 3D surface.
syms u v
x = (-2/15)*cos(u)* (3*cos(v) - 30*sin(u) + 90*(cos(u))^4*sin(u) - 60*(cos(u))^6*sin(u) + 5*cos(u)*cos(v)*sin(u))
y = (-1/15)*sin(u)* (3*cos(v) - 3*(cos(u))^2*cos(v) + 48*(cos(u))^4*cos(v) - 48*(cos(u))^6*cos(v) - 60*sin(u) + 5*cos(u)*cos(v)*sin(u) - 5*(cos(u))^3*cos(v)*sin(u) - 80*(cos(u))^5*cos(v)*sin(u) + 80*(cos(u))^7*cos(v)*sin(u))
z = (2/15)*(3+5*cos(u)*sin(u))*sin(v)
figure(2)
ezsurf(x,y,z,[0, pi, 0, 2*pi])

采纳的回答

KSSV
KSSV 2019-3-25
syms u v
x = (-2/15)*cos(u)* (3*cos(v) - 30*sin(u) + 90*(cos(u))^4*sin(u) - 60*(cos(u))^6*sin(u) + 5*cos(u)*cos(v)*sin(u))
y = (-1/15)*sin(u)* (3*cos(v) - 3*(cos(u))^2*cos(v) + 48*(cos(u))^4*cos(v) - 48*(cos(u))^6*cos(v) - 60*sin(u) + 5*cos(u)*cos(v)*sin(u) - 5*(cos(u))^3*cos(v)*sin(u) - 80*(cos(u))^5*cos(v)*sin(u) + 80*(cos(u))^7*cos(v)*sin(u))
z = (2/15)*(3+5*cos(u)*sin(u))*sin(v)
figure(2)
h = ezsurf(x,y,z,[0, pi, 0, 2*pi]) ;
X = h.XData ;
Y = h.YData ;
Z = h.ZData ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by