diff --git a/PartPreviewWindow/CreateDiscreteMeshes.cs b/PartPreviewWindow/CreateDiscreteMeshes.cs index 9231b9889..52897cc05 100644 --- a/PartPreviewWindow/CreateDiscreteMeshes.cs +++ b/PartPreviewWindow/CreateDiscreteMeshes.cs @@ -85,10 +85,6 @@ namespace MatterHackers.MatterControl attachedFaces.Push(currentFace); meshFromCurrentVolume = new Mesh(); - MeshExtruderData materialDataToCopy = MeshExtruderData.Get(meshToSplit); - MeshExtruderData newMaterialData = MeshExtruderData.Get(meshFromCurrentVolume); - newMaterialData.ExtruderIndex = materialDataToCopy.ExtruderIndex; - while (attachedFaces.Count > 0) { Face faceToAdd = attachedFaces.Pop(); diff --git a/PartPreviewWindow/View3D/BaseObject3DEditor.cs b/PartPreviewWindow/View3D/BaseObject3DEditor.cs index 8f09dfab5..cb7a74161 100644 --- a/PartPreviewWindow/View3D/BaseObject3DEditor.cs +++ b/PartPreviewWindow/View3D/BaseObject3DEditor.cs @@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow solidBehaviorButton.Click += (s, e) => { item.Color = new RGBA_Bytes(rand.Next(255), rand.Next(255), rand.Next(255)); - item.BehaviorType = Behavior3DTypes.Solid; + item.OutputType = PrintOutputTypes.Solid; view3DWidget.Invalidate(); }; @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow holeBehaviorButton.Margin = new BorderDouble(5); holeBehaviorButton.Click += (s, e) => { - item.BehaviorType = Behavior3DTypes.Hole; + item.OutputType = PrintOutputTypes.Hole; view3DWidget.Invalidate(); }; @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow supportBehaviorButton.Margin = new BorderDouble(5); supportBehaviorButton.Click += (s, e) => { - item.BehaviorType = Behavior3DTypes.Support; + item.OutputType = PrintOutputTypes.Support; view3DWidget.Invalidate(); }; diff --git a/PartPreviewWindow/View3D/MeshViewerWidget.cs b/PartPreviewWindow/View3D/MeshViewerWidget.cs index c4ed46817..d4cc189f4 100644 --- a/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -612,11 +612,11 @@ namespace MatterHackers.MeshVisualizer Scene.HasSelection && (object3D == Scene.SelectedItem || Scene.SelectedItem.Children.Contains(object3D)); RGBA_Bytes drawColor = object3D.Color; - if(object3D.BehaviorType == Behavior3DTypes.Support) + if(object3D.OutputType == PrintOutputTypes.Support) { drawColor = new RGBA_Bytes(RGBA_Bytes.Yellow, 120); } - else if(object3D.BehaviorType == Behavior3DTypes.Hole) + else if(object3D.OutputType == PrintOutputTypes.Hole) { drawColor = new RGBA_Bytes(RGBA_Bytes.Gray, 120); } diff --git a/SlicerConfiguration/SlicingQueue.cs b/SlicerConfiguration/SlicingQueue.cs index 78d12699a..d69e4d5e6 100644 --- a/SlicerConfiguration/SlicingQueue.cs +++ b/SlicerConfiguration/SlicingQueue.cs @@ -49,6 +49,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { public class SlicingQueue { + static Dictionary meshPrintOutputSettings = new Dictionary(); private static Thread slicePartThread = null; private static List listOfSlicingItems = new List(); private static bool haltSlicingThread = false; @@ -151,7 +152,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration case ".AMF": case ".OBJ": // TODO: Once graph parsing is added to MatterSlice we can remove and avoid this flattening - List meshGroups = new List { Object3D.Load(fileToSlice, CancellationToken.None).Flatten() }; + meshPrintOutputSettings.Clear(); + List meshGroups = new List { Object3D.Load(fileToSlice, CancellationToken.None).Flatten(meshPrintOutputSettings) }; if (meshGroups != null) { List extruderMeshGroups = new List(); @@ -164,7 +166,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { foreach (Mesh mesh in meshGroup.Meshes) { - MeshExtruderData material = MeshExtruderData.Get(mesh); + MeshPrintOutputSettings material = meshPrintOutputSettings[mesh]; int extruderIndex = Math.Max(0, material.ExtruderIndex); maxExtruderIndex = Math.Max(maxExtruderIndex, extruderIndex); if (extruderIndex >= extruderCount) @@ -216,7 +218,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration mergeRules += ",{0}".FormatWith(savedStlCount); } } - int meshExtruderIndex = MeshExtruderData.Get(mesh).ExtruderIndex; + int meshExtruderIndex = meshPrintOutputSettings[mesh].ExtruderIndex; if (materialsToInclude.Contains(meshExtruderIndex)) { extruderFilesToSlice.Add(SaveAndGetFilePathForMesh(mesh)); @@ -284,10 +286,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration MeshFileIo.Save( extruderMeshGroup, filePath, - new MeshOutputSettings() - { - ExtruderIndexesToSave = materialIndexsToSaveInThisSTL - }); + new MeshOutputSettings()); return filePath; } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index a5af4a908..0aae0a596 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit a5af4a908961f7bc4de1387795084640f9564067 +Subproject commit 0aae0a59605d0eff889c2685bad578a739620159