From b7e051e2d2b784b239a5fa2f5e6185bd7d9415c5 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Tue, 6 Feb 2018 10:34:20 -0800 Subject: [PATCH] Don't save multiple copies of small slice part --- SlicerConfiguration/Slicer.cs | 11 ++++++----- Submodules/MatterSlice | 2 +- Submodules/agg-sharp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/SlicerConfiguration/Slicer.cs b/SlicerConfiguration/Slicer.cs index fc4f65a6a..39160a94e 100644 --- a/SlicerConfiguration/Slicer.cs +++ b/SlicerConfiguration/Slicer.cs @@ -94,10 +94,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration progressStatus.Status = "Loading"; progressReporter.Report(progressStatus); - var reloadedItem = Object3D.Load(fileToSlice, cancellationToken); - - progressStatus.Status = "Flattening"; - progressReporter.Report(progressStatus); + var reloadedItem = Object3D.Load(fileToSlice, cancellationToken, null, (ratio, status) => + { + progressStatus.Progress0To1 = ratio; + progressStatus.Status = status; + }); // Flatten the scene, filtering out items outside of the build volume var meshItemsOnBuildPlate = reloadedItem.VisibleMeshes().Where((item) => item.InsideBuildVolume(printer)); @@ -200,7 +201,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration // Create directory if needed Directory.CreateDirectory(folderToSaveStlsTo); - string filePath = Path.Combine(folderToSaveStlsTo, Path.ChangeExtension(Path.GetRandomFileName(), ".stl")); + string filePath = Path.Combine(folderToSaveStlsTo, Path.ChangeExtension(meshToSave.GetLongHashCode().ToString(), ".stl")); MeshFileIo.Save(meshToSave, filePath, cancellationToken); diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index dd9d2eb75..5e32b78a1 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit dd9d2eb75deb9d18ef0a46104784776a19784268 +Subproject commit 5e32b78a136b424670378064464baaae2807933b diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 69ecfdc23..22614d3c2 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 69ecfdc230f8b1e9b6350eed3feb567b83fc431b +Subproject commit 22614d3c24b814b48da4bb37951416ca14f36924