Pass IEnumerable<IObject3D> to Slice() method
- Issue MatterHackers/MCCentral#5743 XYCalibration print uses bed content rather than calibration template
This commit is contained in:
parent
9f6418f080
commit
8f5a6531b1
4 changed files with 11 additions and 12 deletions
|
|
@ -249,11 +249,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
public static List<(Matrix4X4 matrix, string fileName)> GetStlFileLocations(IObject3D object3D, ref string mergeRules, IEnumerable<IObject3D> printableItems, PrinterSettings settings, IProgress<ProgressStatus> reporter, CancellationToken cancellationToken)
|
||||
public static List<(Matrix4X4 matrix, string fileName)> GetStlFileLocations(ref string mergeRules, IEnumerable<IObject3D> printableItems, PrinterSettings settings, IProgress<ProgressStatus> reporter, CancellationToken cancellationToken)
|
||||
{
|
||||
var progressStatus = new ProgressStatus();
|
||||
|
||||
Slicer.GetExtrudersUsed(Slicer.ExtrudersUsed, printableItems, object3D, settings, true);
|
||||
Slicer.GetExtrudersUsed(Slicer.ExtrudersUsed, printableItems, settings, true);
|
||||
|
||||
// TODO: Once graph parsing is added to MatterSlice we can remove and avoid this flattening
|
||||
meshPrintOutputSettings.Clear();
|
||||
|
|
@ -324,11 +324,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return new List<(Matrix4X4 matrix, string fileName)>();
|
||||
}
|
||||
|
||||
public Task<bool> Slice(IObject3D object3D, IEnumerable<IObject3D> printableItems, PrinterSettings settings, string gcodeFilePath, IProgress<ProgressStatus> reporter, CancellationToken cancellationToken)
|
||||
public Task<bool> Slice(IEnumerable<IObject3D> printableItems, PrinterSettings settings, string gcodeFilePath, IProgress<ProgressStatus> reporter, CancellationToken cancellationToken)
|
||||
{
|
||||
string mergeRules = "";
|
||||
|
||||
var stlFileLocations = GetStlFileLocations(object3D, ref mergeRules, printableItems, settings, reporter, cancellationToken);
|
||||
var stlFileLocations = GetStlFileLocations(ref mergeRules, printableItems, settings, reporter, cancellationToken);
|
||||
|
||||
if (stlFileLocations.Count <= 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public static bool RunInProcess { get; set; } = false;
|
||||
|
||||
public static void GetExtrudersUsed(List<bool> extrudersUsed, IEnumerable<IObject3D> printableItems, IObject3D object3D, PrinterSettings settings, bool checkForMeshFile)
|
||||
public static void GetExtrudersUsed(List<bool> extrudersUsed, IEnumerable<IObject3D> printableItems, PrinterSettings settings, bool checkForMeshFile)
|
||||
{
|
||||
extrudersUsed.Clear();
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
|
||||
// If we have support enabled and are using an extruder other than 0 for it
|
||||
if (object3D.VisibleMeshes().Any(i => i.WorldOutputType() == PrintOutputTypes.Support))
|
||||
if (printableItems.Any(i => i.WorldOutputType() == PrintOutputTypes.Support))
|
||||
{
|
||||
if (settings.GetValue<int>(SettingsKey.support_material_extruder) != 0)
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
var scene = printer.Bed.Scene;
|
||||
|
||||
var extrudersUsed = new List<bool>();
|
||||
Slicer.GetExtrudersUsed(extrudersUsed, printer.PrintableItems(scene), scene, printer.Settings, false);
|
||||
Slicer.GetExtrudersUsed(extrudersUsed, printer.PrintableItems(scene), printer.Settings, false);
|
||||
|
||||
for (int i = 1; i < extrudersUsed.Count; i++)
|
||||
{
|
||||
|
|
@ -127,8 +127,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public static Task<bool> SliceItem(IObject3D object3D, string gcodeFilePath, PrinterConfig printer, IProgress<ProgressStatus> progressReporter, CancellationToken cancellationToken)
|
||||
{
|
||||
var scene = printer.Bed.Scene;
|
||||
return printer.Settings.Slicer.Slice(object3D, printer.PrintableItems(scene), printer.Settings, gcodeFilePath, progressReporter, cancellationToken);
|
||||
return printer.Settings.Slicer.Slice(printer.PrintableItems(object3D), printer.Settings, gcodeFilePath, progressReporter, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue