ebustl_parser

Function parse_stl_from_file

Source
pub fn parse_stl_from_file(filename: &str) -> Result<Stl, ParseError>
Expand description

Reads an STL file and parse it to a Stl struct.

Use crate::parser::parse_stl_from_slice to parse in memory data

ยงExample

use ebustl_parser::parse_stl_from_file;

let stl = parse_stl_from_file("/path/to/subtiltle.stl").expect("Parse stl from file");
println!("{:?}", stl);
Examples found in repository?
examples/dump.rs (line 15)
9
10
11
12
13
14
15
16
17
fn main() {
    if env::args().count() != 2 {
        print_usage();
        process::exit(1);
    }
    let input_filename = env::args().nth(1).unwrap();
    let stl = parse_stl_from_file(&input_filename).expect("Parse stl from file");
    println!("{:?}", stl);
}