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.
siddhesh rane (2020). Function for importing and plotting STL files in MATLAB (https://www.mathworks.com/matlabcentral/fileexchange/41910-function-for-importing-and-plotting-stl-files-in-matlab), MATLAB Central File Exchange. Retrieved .
Worked with a little bit of a change, as my STL had multiple solids included in it. As a result, the parsing for m did not work properly. Had to include the following change:
and remove the m=m+9; line after the j loop.
The only function that works for me. Thanks !
And with the Eric Ludlam's code snippet, I can obtain what I intended. Thank you to both of you.
Crashed and has inadequate documentation to understand what went wrong, so I could not even patch it.
Tried a lot of the functions available. This was the only one that ran error free. Thanks mate!!
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,)';