22.6K Downloads
Updated 24 Feb 2004
No License
Editor's Note: This file was selected as MATLAB Central Pick of the Week
SURF2STL Write STL file from surface data.
SURF2STL('filename',X,Y,Z) writes a stereolithography (STL) file
for a surface with geometry defined by three matrix arguments, X, Y
and Z. X, Y and Z must be two-dimensional arrays with the same size.
SURF2STL('filename',x,y,Z), uses two vector arguments replacing
the first two matrix arguments, which must have length(x) = n and
length(y) = m where [m,n] = size(Z). Note that x corresponds to
the columns of Z and y corresponds to the rows.
SURF2STL('filename',dx,dy,Z) uses scalar values of dx and dy to
specify the x and y spacing between grid points.
SURF2STL(...,'mode') may be used to specify the output format.
'binary' - writes in STL binary format (default)
'ascii' - writes in STL ASCII format
Example:
surf2stl('test.stl',1,1,peaks);
See also SURF.
Author: Bill McDonald, 02-20-04
Cite As
Bill McDonald (2023). surf2stl (/matlabcentral/fileexchange/4512-surf2stl), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > STL (STereoLithography) >
Tags
Acknowledgements
Inspired: stlwrite - write ASCII or Binary STL files, surf2solid
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |