butterfly.stl package

Module contents

butterfly.stl.read_ascii_file(file)[source]

Read an STL file in the ASCII format.

Takes a file-like object (supporting a read method) and returns a stl.Solid object representing the data from the file.

If the file is invalid in any way, raises stl.ascii.SyntaxError.

butterfly.stl.read_ascii_string(data)[source]

Read geometry from a str containing data in the STL ASCII format.

This is just a wrapper around read_ascii_file() that first wraps the provided string in a StringIO.StringIO object.

butterfly.stl.read_binary_file(file)[source]

Read an STL file in the binary format.

Takes a file-like object (supporting a read method) and returns a stl.Solid object representing the data from the file.

If the file is invalid in any way, raises stl.binary.FormatError.

butterfly.stl.read_binary_string(data)[source]

Read geometry from a str containing data in the STL binary format.

This is just a wrapper around read_binary_file() that first wraps the provided string in a StringIO.StringIO object.