stl

package module
v0.0.0-...-1ddb09e Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2017 License: MIT Imports: 10 Imported by: 3

README

Build Status

This is a simple and not yet stable Go library to work with STL files.

It's capable to read/write binary and ascii STL files.

Patches are welcome.

Documentation

Index

Constants

View Source
const SizeOfTriangle = 4*3*4 + 2

Variables

This section is empty.

Functions

func WriteASCII

func WriteASCII(w io.Writer, t []Triangle) error

WriteASCII writes the triangle mesh to the writer using ASCII STL codec.

func WriteBinary

func WriteBinary(w io.Writer, t []Triangle) error

Write writes the triangle mesh to the writer using binary STL codec.

Types

type Point

type Point [3]float64

Point represent a point or vector in 3-dimensional space.

func BoundingBox

func BoundingBox(t []Triangle) (min, max Point)

BoundingBox find a minimum cube that wraps the model.

type Triangle

type Triangle struct {
	N Point
	V [3]Point
}

Triangle consists of a normal vector and 3 points in 3-dimensional space.

func Read

func Read(r io.Reader) (t []Triangle, err error)

Read reads STL file from the reader.

Jump to

Keyboard shortcuts

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