8000 GitHub - neilpa/go-stl: Go STL file decoder
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

neilpa/go-stl

Repository files navigation

go-stl

CI GoDoc

Simple go library for decoding binary and ASCII STL files as well as binary encoder.

Usage

Reading triangle vertices of a binary or ASCII STL file

package main

import (
    "fmt"
    "log"
    "os"

    "neilpa.me/go-stl"
)

func main() {
    f, err := os.Open("path/to/mesh.stl")
    if err != nil {
        log.Fatal(err)
    }

    mesh, err := stl.Decode(f)
    if err != nil {
        log.Fatal(err)
    }

    for _, face := range mesh.Faces {
        fmt.Println(face.Verts)
    }
}

See also stlbox for an example of calculating the bounding box.

License

MIT

About

Go STL file decoder

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0