The file may not be time and space efficient but i think its well documented and can be easily understood by beginners.To avoid complexity file does not consider normal vectors.
Unfortunately this function didn't work for me. Wouldn't read the file.
Error in readSTL (line 4)
Open to suggestions?
I like this simple reader which worked great for output from openSCAD.
I used this code snippet to convert the coordinate return value into something I could drop right onto a patch object:
verts = reshape(coordinates,3,)';
tri = reshape(1:size(verts,1),3,)';
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.