Popularity
0.7
Growing
Activity
0.9
-
4
1
1

Description

This module provides methods for reading and writing STL. It is written using a concurrent algorithm so that reads are faster than sequential packages.

Mirrored on GitHub from GitLab: https://gitlab.com/russoj88/stl

Programming language: Go
Tags: Go Tools     Go     Golang     Stl     3d Printing     Stereolithography    
Latest version: v1.0.2

stl alternatives and similar packages

Based on the "Go Tools" category

Do you think we are missing an alternative of stl or a related project?

Add another 'Go Tools' Package

README

STL

This is an STL reader and writer written in Go.

Package use

From, To

These core methods are to handle reading from an io.Reader and writing to an io.Writer. Because most applications use files, these are wrapped in helper functions explained below.

FromFile

This takes in a filename and will return an stl.Solid. This read method will automatically determine if the file is binary or ASCII and handle it appropriately.

This reader is concurrent. For binary files, it gives about a 60% speedup on an E3-1231 v3 @ 3.40GHz reading off a SATA SSD.

ToASCIIFile

This will write an stl.Solid to a file in ASCII format. The representations of the numbers are minimized to save some space.

ToBinaryFile

This will write an stl.Solid to a file in binary format. This format is much more space efficient.

Examples

Read from a file
solid, err := stl.FromFile("/path/to/file.stl")
if err != nil {
    t.Errorf("could not read stl: %v", err)
}
Write to a file (ASCII)
err = solid.ToASCIIFile("/path/to/file.stl")
if err != nil {
    t.Errorf("could not write to file: %v", err)
}

[Contributing](contributing.md)

[License](license)


*Note that all licence references and agreements mentioned in the stl README section above are relevant to that project's source code only.