How to convert 3D plot to .STL

51 views (last 30 days)
승준 이
승준 이 on 17 Oct 2021
Commented: Dyuman Joshi on 21 Feb 2024
I wonder how to export an implicit 3D function to a .STL file for 3D printing.
I have searched for some tools like
but cannot figure out how to do it. The following code is the 3D plot that I want to convert to .STL. Thank you in advance.
h=fimplicit3(@kidney2);
set(h, 'EdgeColor', 'none', 'MeshDensity', 125);
view(-110,80)
axis([-0.1, 0.1, -0.1, 0.1, 0, 0.5])
function out=kidney2(x,y,z)
kidney1=@(x,y,z) (x.^2+y.^2).^(2)-(x.^3+y.^3).*(z/4-z.^2).^(1/2);
dt=0.25*(z/4-z.^2).^(1/2);
out=kidney1(x+dt,y+dt,z);
end

Answers (1)

Raghava S N
Raghava S N on 21 Feb 2024
Hello,
A possible solution is to download the “stlwrite.m” file from the following link: https://www.mathworks.com/matlabcentral/fileexchange/20922-stlwrite-write-ascii-or-binary-stl-files
This is prescribed by a MathWorks staff member in the following MATLAB Answer - https://www.mathworks.com/matlabcentral/answers/623773-how-to-generate-a-stl-file-starting-from-a-3d-figure#:~:text=You%20need%20to%20download%20the%20stlwrite.m%20file%20from%20the%20following%20link%3A.You can refer to the same MATLAB Answer, where they also describe some intricacies of “stlwrite”.
  1 Comment
Dyuman Joshi
Dyuman Joshi on 21 Feb 2024
These solutions won't work because there is no data available corresponding to implicit surface generated.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!