Skip to content

A zero dependency STL data reader written in Zig inspired by MicroSTL

License

Notifications You must be signed in to change notification settings

lsh/tinystl-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

const StlData = @include("stldata.zig").StlData;

pub fn main() !void {
 var allocator = std.heap.page_allocator;
 var file = try std.fs.cwd().openFile("my_mesh.stl", .{});
 defer file.close();
 var data = try StlData.readFromFile(file, allocator, .{});
 defer data.deinit();

 var out_file = try std.fs.cwd().createFile("my_mesh_output.stl", .{});
 defer out_file.close();
 try data.writeBinaryFile(file, .{});
}

About

A zero dependency STL data reader written in Zig inspired by MicroSTL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages