stl

package
v0.0.0-...-13b082e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncompleteBinaryHeader = errors.New("Incomplete STL binary header, 84 bytes expected")

ErrIncompleteBinaryHeader is used when reading binary STL files with incomplete header.

View Source
var ErrUnexpectedEOF = errors.New("Unexpected end of file")

ErrUnexpectedEOF is used by ReadFile and ReadAll to signify an incomplete file.

Functions

func ReadAll

func ReadAll(r io.Reader) (mesh *meshful.Mesh, err error)

ReadAll reads the contents of a file into a new Mesh object. The file can be either in STL ASCII format, beginning with "solid ", or in STL binary format, beginning with a 84 byte header. Because of this, the file pointer has to be at the beginning of the file.

func ReadFile

func ReadFile(filename string) (mesh *meshful.Mesh, err error)

ReadFile reads the contents of a file into a new Mesh object. The file can be either in STL ASCII format, beginning with "solid ", or in STL binary format, beginning with a 84 byte header. Shorthand for os.Open and ReadAll

func WriteAll

func WriteAll(w io.Writer, mesh *meshful.Mesh) error

WriteAll writes the contents of this mesh to an io.Writer. Depending on solid.IsAscii the STL ASCII format, or the STL binary format is used. If IsAscii is false, and the binary format is used, solid.Name will be used for the header, if solid.BinaryHeader is empty.

func WriteFile

func WriteFile(filename string, mesh *meshful.Mesh) error

WriteFile creates file with name filename and write contents of this Solid. Shorthand for os.Create and Solid.WriteAll

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL