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