No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.6 | 10 ratings Rate this file 32 Downloads (last 30 days) File Size: 1.8 KB File ID: #6678 Version: 1.0



Doron Harlev (view profile)


04 Jan 2005 (Updated )

Read STL file into MATLAB patch compatible matrixes.

| Watch this File

File Information

This function reads a binary SPL file into X, Y, Z, C matrixes compatible with the MATLAB patch function.

See, , for more information on the format.


This file inspired Binary Stl File Reader and Stlread Slim Fv(File).

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
22 Nov 2016 Yanyu Peng

nice code

13 Sep 2016 Zi Tao

Zi Tao (view profile)


10 Apr 2014 agdfg sdgfdg

when i'm using above code .I'm getting Error using stlread (line 16)
Not enough input arguments.
16---fid=fopen....highlighting fid

Comment only
05 Jan 2011 Francis Esmonde-White

I have re-written this function to be much faster.


Comment only
04 Jan 2011 Francis Esmonde-White

04 Jan 2011 Francis Esmonde-White

15 Nov 2010 Otília

Please, anyone knows why do I get this MatLab errors when I try to read my STL file?

Title: solid BVMESH

facet normal 0.248 -0.299 0.922

outer loop

Num Facets: 775500593
??? Error using ==> zeros
Maximum variable size allowed by the program is exceeded.

Error in ==> stlread at 28
x=zeros(3,num_facet); y=zeros(3,num_facet); z=zeros(3,num_facet);

Thank you...

Comment only
22 Jan 2009 Luigi Giaccari

Althought a little slow is very useful to import stl ascii files, I think the slowness dependes on not preallocate arrays in the importation loop.

06 Aug 2007 prasad k

thanks for this code
it is very useful to me
once again thanks

15 Mar 2007 Abir Chakraborty

Works exactly as needed. Saves lot of time. Thanks a lot.

22 Feb 2007 Tom Price

Works very nice. Thanks.

29 Aug 2006 Reviewing M Files

For all the trial stl files used I get the "Error using ==> zeros
Product of dimensions is greater than maximum integer."
Please enlighten. Thanks

Comment only
29 Aug 2006 Reviewing M Files

Title: solid MyObj
facet normal 0.955654E-01 -0.966960E+00 0.236339E+00
Num Facets: 1886351212
??? Error using ==> zeros
Product of dimensions is greater than maximum integer.

Error in ==> E:\MyDownloads\stlread.m
On line 28 ==> x=zeros(3,num_facet); y=zeros(3,num_facet); z=zeros(3,num_facet);

Comment only
18 Nov 2005 Christophe Henrard

Works perfectly fine! Thank you

12 May 2005 Zoltan Sarosi

Very good! It is exactly I was looking for. Thank you!

Contact us