How can I generate an .stl file from a symbolically generated 3D surface?
5 views (last 30 days)
Show older comments
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])
0 Comments
Accepted Answer
KSSV
on 25 Mar 2019
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 Comments
More 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!