File Exchange

image thumbnail

stlread

version 1.0.0.0 (967 Bytes) by Doron Harlev
Read STL file into MATLAB patch compatible matrixes.

59 Downloads

Updated 07 Jan 2005

No License

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

See, http://rpdrc.ic.polyu.edu.hk/old_files/stl_binary_format.htm , for more information on the format.

Comments and Ratings (18)

derboon

Chan Grown

非常好的代码,节约了大量时间

wenlong

nice code, it did work and plot beautiful graph, thanks

Yanyu Peng

nice code

Zi Tao

good

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

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

vertex
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...

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.

prasad k

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

Abir Chakraborty

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

Tom Price

Works very nice. Thanks.

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

Reviewing M Files

Title: solid MyObj
facet normal 0.955654E-01 -0.966960E+00 0.236339E+00
outer
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);

Christophe Henrard

Works perfectly fine! Thank you

Zoltan Sarosi

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

Updates

1.0.0.0

Added read color capability.

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor