reshape error in an .stl writer?
6 views (last 30 days)
Show older comments
So i've used an function, stlread, to import an .stl files information (faces, vertices, and normals) into matlab and am now trying to export them as an .stl. The problem is that the function I'm using to take the faces and vertices and write them to an stl file has this line of code: facets = reshape(facets(:,ceil(faces)'), 3, 3, []); which doesn't like that faces is an array of non integers. However, that's the array that the .stl reader outputs. Here's the stl reader: http://www.mathworks.com/matlabcentral/fileexchange/6678-stlread and here's the .stl writer: http://www.mathworks.com/matlabcentral/fileexchange/20922-stlwrite-write-binary-or-ascii-stl-file and help is greatly appreciated! Thank you very much!
1 Comment
Jan
on 4 Mar 2015
Please explain, why you assume that the program "doesn't like that faces is an array of non integers".
Answers (1)
DGM
on 2 Apr 2025
Edited: DGM
on 2 Apr 2025
There are many files called "stlread()", but FEX #6678 stlread() does not return face/vertex data. It combines the FV data and returns direct xyz lists. When you use it, you're throwing away all your face/vertex lists. You might be able to reassemble everything into face and vertex lists, but it would be a waste of time. Don't use it if you don't want it formatted that way.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!