Cleanup cargo configs
This commit is contained in:
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[build]
|
||||||
|
rustflags = ["-Ctarget-cpu=native"]
|
@@ -3,7 +3,5 @@ name = "common"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra = "0.32.6"
|
nalgebra = "0.32.6"
|
||||||
|
@@ -3,11 +3,9 @@ name = "goo_format"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.86"
|
anyhow = "1.0.86"
|
||||||
clap = { version = "4.5.7", features = ["derive"] }
|
clap = { version = "4.5.7", features = ["derive"] }
|
||||||
|
image = "0.25.1"
|
||||||
|
|
||||||
common = { path = "../common" }
|
common = { path = "../common" }
|
||||||
image = "0.25.1"
|
|
||||||
|
@@ -3,8 +3,6 @@ name = "slicer"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.86"
|
anyhow = "1.0.86"
|
||||||
nalgebra = "0.32.6"
|
nalgebra = "0.32.6"
|
||||||
|
@@ -102,32 +102,34 @@ impl Slicer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut image = Image::blank(
|
// let mut image = Image::blank(
|
||||||
self.slice_config.platform_resolution.x as usize,
|
// self.slice_config.platform_resolution.x as usize,
|
||||||
self.slice_config.platform_resolution.y as usize,
|
// self.slice_config.platform_resolution.y as usize,
|
||||||
);
|
// );
|
||||||
|
|
||||||
|
let mut encoder = Layer::new();
|
||||||
|
|
||||||
let mut last = 0;
|
let mut last = 0;
|
||||||
for (start, end) in out {
|
for (start, end) in out {
|
||||||
if start > last {
|
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}");
|
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;
|
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)
|
encoder.finish(layer as usize, slice_config)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
self.progress.notify.notify_all();
|
||||||
|
|
||||||
SliceResult {
|
SliceResult {
|
||||||
layers,
|
layers,
|
||||||
slice_config: &self.slice_config,
|
slice_config: &self.slice_config,
|
||||||
|
Reference in New Issue
Block a user