Code covered by the BSD License  

Highlights from
STL File Reader

3.83333

3.8 | 7 ratings Rate this file 107 Downloads (last 30 days) File Size: 1.6 MB File ID: #22409
image thumbnail

STL File Reader

by Eric Johnson

 

11 Dec 2008 (Updated 20 Jul 2011)

STLREAD imports geometry from a binary stereolithography (STL) file into MATLAB.

| Watch this File

File Information
Description

In addition to the STLREAD import function, this submission also includes a small demo that loads an STL model of a human femur bone.

FV = STLREAD(FILENAME) imports triangular faces from the binary STL file
indicated by FILENAME, and returns the patch struct FV, with fields 'faces'
and 'vertices'.

[F,V] = STLREAD(FILENAME) returns the faces F and vertices V separately.

[F,V,N] = STLREAD(FILENAME) also returns the face normal vectors.

The faces and vertices are arranged in the format used by the PATCH plot
object.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (9)
12 Dec 2008 alain boyer  
16 Jan 2009 Jveer

very useful!

can the vertices and faces be arranged such that they can be used with surf??

textures cannot be applied to patch objects. surf is more useful.

22 Jan 2009 Luigi Giaccari

Very useful for binary filesl but do not support ascii format

04 Jan 2010 By ?

very good

05 Jan 2011 Francis Esmonde-White

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

See:
http://www.mathworks.com/matlabcentral/fileexchange/29906-binary-stl-file-reader

11 Dec 2011 Morteza Shahpari

Very nice and useful.
Thanks

12 Dec 2011 Morteza Shahpari  
15 Dec 2011 Robert

Thanks for your submittal. What units is the model in once I've read the stl file with Matlab. I am using NextEngine's 3D scanner and they are telling me that the units are defined by the reader utility.

23 Dec 2011 Santosh ARS

i think this gives wrong faces? Please confirm.

Please login to add a comment or rating.
Updates
31 Dec 2009

None

20 Jul 2011

Updated submission with example script and 3D model.

Tag Activity for this File
Tag Applied By Date/Time
data import Cristina McIntire 12 Dec 2008 15:00:57
data export Cristina McIntire 12 Dec 2008 15:00:57
geometry Cristina McIntire 12 Dec 2008 15:00:57
cad Eric Johnson 12 Dec 2008 15:01:10
stereolithography Eric Johnson 12 Dec 2008 15:01:10
stl Eric Johnson 12 Dec 2008 15:01:10
geometry Eric Johnson 12 Dec 2008 15:01:10
data import Eric Johnson 12 Dec 2008 15:01:10
faces Eric Johnson 12 Dec 2008 15:01:10
vertices Eric Johnson 12 Dec 2008 15:01:10
patch Eric Johnson 12 Dec 2008 15:01:10
triangle mesh Eric Johnson 12 Dec 2008 15:01:10
read stl Oliver Woodford 29 Jul 2010 04:26:03
load stl Oliver Woodford 29 Jul 2010 04:26:08

Contact us at files@mathworks.com