microcad_export/json/
mod.rs1use microcad_lang::{
7 builtin::{ExportError, Exporter, FileIoInterface},
8 model::{Model, OutputType},
9 value::Value,
10 Id,
11};
12
13pub struct JsonExporter;
15
16impl Exporter for JsonExporter {
17 fn export(&self, model: &Model, filename: &std::path::Path) -> Result<Value, ExportError> {
18 log::debug!("Exporting model into {filename:?}");
19 let mut f = std::fs::File::create(filename)?;
20 log::trace!("Model to export:\n{model}");
21 let _writer = std::io::BufWriter::new(&mut f);
22 todo!("export json");
23 }
24
25 fn output_type(&self) -> OutputType {
26 OutputType::Geometry3D
27 }
28}
29
30impl FileIoInterface for JsonExporter {
31 fn id(&self) -> Id {
32 Id::new("json")
33 }
34}