Document fj-export

This commit is contained in:
Hanno Braun 2022-04-13 13:48:21 +02:00
parent d96b3ef29d
commit 61a11550b2

View File

@ -1,8 +1,16 @@
//! Exporting Fornjot models to external files
#![deny(missing_docs)]
use std::path::Path; use std::path::Path;
use fj_interop::mesh::Mesh; use fj_interop::mesh::Mesh;
use fj_math::Point; use fj_math::Point;
/// Export the provided mesh to the file at the given path
///
/// Currently only 3MF is supported as an export format. The file extension of
/// the provided path is ignored.
pub fn export(mesh: &Mesh<Point<3>>, path: &Path) -> Result<(), Error> { pub fn export(mesh: &Mesh<Point<3>>, path: &Path) -> Result<(), Error> {
let vertices = mesh.vertices().map(|vertex| vertex.into()).collect(); let vertices = mesh.vertices().map(|vertex| vertex.into()).collect();