Expand description
Wavefront OBJ format import and export.
This module provides conversion between OBJ files and 3MF Model structures.
§OBJ Format
The Wavefront OBJ format is a text-based 3D geometry format. This implementation supports a basic subset of the full OBJ specification:
Supported features:
v- Vertex positions (x, y, z)f- Faces (vertex indices)- Polygon faces (automatically triangulated using fan triangulation)
Ignored features:
vt- Texture coordinatesvn- Vertex normalsg- Group namesusemtl- Material referencesmtllib- Material library files
§Examples
§Importing OBJ
use lib3mf_converters::obj::ObjImporter;
use std::fs::File;
let file = File::open("model.obj")?;
let model = ObjImporter::read(file)?;
println!("Imported model with {} build items", model.build.items.len());§Exporting OBJ
use lib3mf_converters::obj::ObjExporter;
use lib3mf_core::model::Model;
use std::fs::File;
let file = File::create("output.obj")?;
ObjExporter::write(&model, file)?;Structs§
- ObjExporter
- Exports 3MF
Modelstructures to Wavefront OBJ files. - ObjImporter
- Imports Wavefront OBJ files into 3MF
Modelstructures.