diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..03f4879 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-Ctarget-cpu=native"] diff --git a/common/Cargo.toml b/common/Cargo.toml index 4b13b2a..bac9a2b 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -3,7 +3,5 @@ name = "common" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] nalgebra = "0.32.6" diff --git a/goo_format/Cargo.toml b/goo_format/Cargo.toml index a16e2b6..010a330 100644 --- a/goo_format/Cargo.toml +++ b/goo_format/Cargo.toml @@ -3,11 +3,9 @@ name = "goo_format" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] anyhow = "1.0.86" clap = { version = "4.5.7", features = ["derive"] } +image = "0.25.1" common = { path = "../common" } -image = "0.25.1" diff --git a/slicer/Cargo.toml b/slicer/Cargo.toml index ca69252..7fa825e 100644 --- a/slicer/Cargo.toml +++ b/slicer/Cargo.toml @@ -3,8 +3,6 @@ name = "slicer" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] anyhow = "1.0.86" nalgebra = "0.32.6" diff --git a/slicer/src/slicer.rs b/slicer/src/slicer.rs index 78c3b04..8a18b63 100644 --- a/slicer/src/slicer.rs +++ b/slicer/src/slicer.rs @@ -102,32 +102,34 @@ impl Slicer { } } - let mut image = Image::blank( - self.slice_config.platform_resolution.x as usize, - self.slice_config.platform_resolution.y as usize, - ); + // let mut image = Image::blank( + // self.slice_config.platform_resolution.x as usize, + // self.slice_config.platform_resolution.y as usize, + // ); + + let mut encoder = Layer::new(); let mut last = 0; for (start, end) in out { if start > last { - image.add_run((start - last) as usize, 0); + encoder.add_run(start - last, 0); } assert!(end >= start, "End precedes start in layer {layer}"); - image.add_run((end - start) as usize, 255); + encoder.add_run(end - start, 255); last = end; } - let mut encoder = Layer::new(); - - for Run { length, value } in image.runs() { - encoder.add_run(length, value); - } + // for Run { length, value } in image.runs() { + // encoder.add_run(length, value); + // } encoder.finish(layer as usize, slice_config) }) .collect::>(); + self.progress.notify.notify_all(); + SliceResult { layers, slice_config: &self.slice_config,