stlread
Create triangulation from STL file
📝Syntax
TR = stlread(filename)
[TR, fileformat, attributes, solidID] = stlread(filename)
📄Description

stlread reads binary or text STL files and returns a triangulation object.

fileformat is 'binary' or 'text'. For binary files, attributes is a uint16 column vector. For text files, attributes is an empty uint16 matrix with one row per triangle. solidID is a column vector identifying the solid group of each triangle.

💡Examples
Write and read a simple STL file.
P = [0 0 0; 1 0 0; 0 1 0];
T = [1 2 3];
TR = triangulation(T, P);
filename = [tempdir(), 'simple.stl'];
stlwrite(TR, filename);
[TR2, fileformat, attributes, solidID] = stlread(filename)
🔗See Also
stlwritetriangulation
🕔Version History
Version Description
2.0.0 Initial version.
Edit this page on GitHub