Improving slice meta data
This commit is contained in:
parent
22a8eec673
commit
ce3c69e825
5 changed files with 12 additions and 17 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
public class SlicingQueue
|
||||
{
|
||||
static Dictionary<Mesh, MeshPrintOutputSettings> meshPrintOutputSettings = new Dictionary<Mesh, MeshPrintOutputSettings>();
|
||||
private static Thread slicePartThread = null;
|
||||
private static List<PrintItemWrapper> listOfSlicingItems = new List<PrintItemWrapper>();
|
||||
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<MeshGroup> meshGroups = new List<MeshGroup> { Object3D.Load(fileToSlice, CancellationToken.None).Flatten() };
|
||||
meshPrintOutputSettings.Clear();
|
||||
List<MeshGroup> meshGroups = new List<MeshGroup> { Object3D.Load(fileToSlice, CancellationToken.None).Flatten(meshPrintOutputSettings) };
|
||||
if (meshGroups != null)
|
||||
{
|
||||
List<MeshGroup> extruderMeshGroups = new List<MeshGroup>();
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit a5af4a908961f7bc4de1387795084640f9564067
|
||||
Subproject commit 0aae0a59605d0eff889c2685bad578a739620159
|
||||
Loading…
Add table
Add a link
Reference in a new issue