Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 788 Bytes

README.md

File metadata and controls

38 lines (22 loc) · 788 Bytes

stlread() for Octave

Description

stlread() is a function for octave that takes in a binary (NOT ASCII) .stl'a and outputs the vertices and a list of each face's vertices.

stlread() outputs 2 matrices that can be immediately ploted using patch()

Usage

Retrieving the vertices and faces is easy

%assuming you have a file "sample.stl"
[vertices, faces, c] = stlread('sample.stl');

In order to plot these you might follow with

patch( 'Faces', faces, 'Vertices', vertices );

Limitations

Thanks to edits by @zmughal code runs ~100x faster now. most STLs <40 MB should be quick.

Future

stlview() function is being tested. it may be incorporated into the stlread() function, or become an independent function.