neco-stl 0.1.0

STL file parser and writer with vertex deduplication
Documentation
  • Coverage
  • 77.78%
    7 out of 9 items documented0 out of 6 items with examples
  • Size
  • Source code size: 20.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.66 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 17s Average build duration of successful builds.
  • all releases: 1m 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • barineco/neco-crates
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • barineco

neco-stl

日本語

STL file parser and writer with vertex deduplication for triangle surface meshes.

Features

  • Parse binary STL
  • Parse ASCII STL
  • Deduplicate vertices into indexed triangles
  • Filter degenerate triangles
  • Write binary and ASCII STL files
  • Extract face normals and sharp feature edges

Usage

[dependencies]
neco-stl = { path = "../neco-stl" }
use neco_stl::parse_stl;

let bytes = std::fs::read("mesh.stl")?;
let surface = parse_stl(&bytes)?;
println!("nodes={}, triangles={}", surface.nodes.len(), surface.triangles.len());
# Ok::<(), Box<dyn std::error::Error>>(())

API

Item Description
TriSurface Indexed triangle surface mesh
parse_stl(data) Parse STL bytes into TriSurface
write_stl_binary(nodes, triangles, path) Write binary STL
write_stl_ascii(nodes, triangles, path) Write ASCII STL
TriSurface::face_normals() Compute per-face normals
TriSurface::feature_edges(angle_threshold_deg) Extract boundary and sharp edges

License

MIT