STL reader and writer written in Go (mirror from GitLab)

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

License

Similar Resources

Common algorithms written in Go.

Common Algorithms in Go This repository contains a collection of a variety of common algorithms implemented using Go. Algorithms Implemented Search Li

Dec 28, 2021

Mmpxmas-go - ModMyPi Programmable Christmas Tree examples written in Go with go-rpio

ModMyPi Programmable Christmas Tree examples in Go This small program contains examples similar to the examples provided by ModMyPi for interacting wi

Jan 4, 2022

This repo is where I'll be attempting to capture some generic algorithms written in Go

Go Generic Algorithms Welcome friends! 👋 This repo is where I'll be attempting

Apr 13, 2022

estruct traverses javascript projects and maps all the dependencies and relationships to a JSON. the output can be used to build network visualizations of the project and document the architecture.

estruct traverses javascript projects and maps all the dependencies and relationships to a JSON. the output can be used to build network visualizations of the project and document the architecture.

EStruct traverses javascript projects and maps all the dependencies and relationships to a JSON. The output can be used to build network visualizations of the project and document the architecture.

Jan 27, 2022

Golang string comparison and edit distance algorithms library, featuring : Levenshtein, LCS, Hamming, Damerau levenshtein (OSA and Adjacent transpositions algorithms), Jaro-Winkler, Cosine, etc...

Go-edlib : Edit distance and string comparison library Golang string comparison and edit distance algorithms library featuring : Levenshtein, LCS, Ham

Dec 20, 2022

Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves.

Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves.

Hilbert Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. Documentation available here This is not an

Dec 23, 2022

Levenshtein distance and similarity metrics with customizable edit costs and Winkler-like bonus for common prefix.

A Go package for calculating the Levenshtein distance between two strings This package implements distance and similarity metrics for strings, based o

Dec 15, 2022

Decode / encode XML to/from map[string]interface{} (or JSON); extract values with dot-notation paths and wildcards. Replaces x2j and j2x packages.

mxj - to/from maps, XML and JSON Decode/encode XML to/from map[string]interface{} (or JSON) values, and extract/modify values from maps by key or key-

Dec 22, 2022

Dasel - Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool.

Dasel - Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool.

Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.

Jan 1, 2023
Related tags
An yet-another red-black tree implementation, with a C++ STL-like API.

A red-black tree with an API similar to C++ STL's. INSTALLATION go get github.com/yasushi-saito/rbtree EXAMPLE More examples can be fou

Apr 25, 2022
Highly concurrent drop-in replacement for bufio.Writer

concurrent-writer Highly concurrent drop-in replacement for bufio.Writer. concurrent.Writer implements highly concurrent buffering for an io.Writer ob

Nov 20, 2022
CLRS study. Codes are written with golang.

algorithms CLRS study. Codes are written with golang. go version: 1.11 Heap BinaryHeap on array BinaryHeap on linkedlist LeftistHeap FibonacciHeap Tre

Dec 26, 2022
A Merkle Tree implementation written in Go.
A Merkle Tree implementation written in Go.

Merkle Tree in Golang An implementation of a Merkle Tree written in Go. A Merkle Tree is a hash tree that provides an efficient way to verify the cont

Jan 5, 2023
High-performance minimalist queue implemented using a stripped-down lock-free ringbuffer, written in Go (golang.org)

This project is no longer maintained - feel free to fork the project! gringo A high-performance minimalist queue implemented using a stripped-down loc

Oct 24, 2022
Graph algorithms written in Go

Graph Algorithms in Go This repository contains implementations of various graph algorithms written in Go. I’ve written them to learn about these algo

Dec 26, 2022
AVL tree with some useful extensions written in Go

gocover An AVL tree (Adel'son-Vel'skii & Landis) is a binary search tree in which the heights of the left and right subtrees of the root differ by at

Mar 23, 2022
Protocol Buffer compiler written in Go

gotoc This is gotoc, a protocol buffer compiler written in Go. This is only the parser side; you will need a plugin to generate code. Quick Start go g

Nov 29, 2022
Bloomfilter written in Golang.

go-bloom-filter BloomFilter written in Golang. Implementations This repository contains several bloomfilter implementations that you can use to solve

Nov 8, 2021
A close implementation of JavaScript's Set written in Go

Set The Set struct allows unique values storing of any type. Initializing a Set s := set.New() // Empty Set s := set.New("hi", 45, Person{name: "Gophe

Dec 20, 2021