Don't save multiple copies of small slice part

This commit is contained in:
Lars Brubaker 2018-02-06 10:34:20 -08:00
parent de8c91fcdb
commit b7e051e2d2
3 changed files with 8 additions and 7 deletions

View file

@ -94,10 +94,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
progressStatus.Status = "Loading"; progressStatus.Status = "Loading";
progressReporter.Report(progressStatus); progressReporter.Report(progressStatus);
var reloadedItem = Object3D.Load(fileToSlice, cancellationToken); var reloadedItem = Object3D.Load(fileToSlice, cancellationToken, null, (ratio, status) =>
{
progressStatus.Status = "Flattening"; progressStatus.Progress0To1 = ratio;
progressReporter.Report(progressStatus); progressStatus.Status = status;
});
// Flatten the scene, filtering out items outside of the build volume // Flatten the scene, filtering out items outside of the build volume
var meshItemsOnBuildPlate = reloadedItem.VisibleMeshes().Where((item) => item.InsideBuildVolume(printer)); var meshItemsOnBuildPlate = reloadedItem.VisibleMeshes().Where((item) => item.InsideBuildVolume(printer));
@ -200,7 +201,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
// Create directory if needed // Create directory if needed
Directory.CreateDirectory(folderToSaveStlsTo); 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); MeshFileIo.Save(meshToSave, filePath, cancellationToken);

@ -1 +1 @@
Subproject commit dd9d2eb75deb9d18ef0a46104784776a19784268 Subproject commit 5e32b78a136b424670378064464baaae2807933b

@ -1 +1 @@
Subproject commit 69ecfdc230f8b1e9b6350eed3feb567b83fc431b Subproject commit 22614d3c24b814b48da4bb37951416ca14f36924