#stl #mesh #write #read-write #loader #binary #micro-stl

tinystl

A small library to read and write STL mesh files, inspired by MicroSTL

3 releases

0.0.3 Mar 15, 2023
0.0.2 Feb 27, 2023
0.0.1 Feb 27, 2023

#1223 in Encoding

Download history 193/week @ 2024-02-18 820/week @ 2024-02-25 646/week @ 2024-03-03 918/week @ 2024-03-10 1613/week @ 2024-03-17 966/week @ 2024-03-24 979/week @ 2024-03-31

4,522 downloads per month
Used in 5 crates (via re_renderer)

MIT license

75KB
425 lines

TinySTL - A small loader for STL files.

This project is heavily inspired by, and adapted from, cry-inc's microstl library. The goal is to provide a zero-dependency way to easily load and write STL files. It is assumed that all binary files are little endian.

Example

use tinystl::StlData;

let data = StlData::read_from_file("my_file.stl")?;
data.write_binary_file("my_binary_file.stl")?;

Features

Bytemuck

Derives Pod for Triangle.

Serde

Derives Serialize and Deserialize for all types.


lib.rs:

TinySTL - A small loader for STL files.

This project is heavily inspired by, and adapted from, cry-inc's microstl library. The goal is to provide a zero-dependency way to easily load and write STL files. It is assumed that all binary files are little endian.

Example

use tinystl::StlData;
let data = StlData::read_from_file("my_file.stl")?;
data.write_binary_file("my_binary_file.stl")?;

Features

Bytemuck

Derives Pod for Triangle.

Serde

Derives Serialize and Deserialize for all types.

Dependencies

~210KB