Made a mapping for slic3r
Fixed slic3r bed shape Fixed slic3r centering
This commit is contained in:
parent
ba475a14bb
commit
4fe9457901
6 changed files with 243 additions and 154 deletions
|
|
@ -418,7 +418,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
if (!string.IsNullOrWhiteSpace(saveParams.FileName))
|
||||
{
|
||||
GenerateConfigFile(saveParams.FileName, false);
|
||||
Slic3rEngineMappings.WriteSliceSettingsFile(saveParams.FileName);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -430,24 +430,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
});
|
||||
}
|
||||
|
||||
public void GenerateConfigFile(string fileName, bool replaceMacroValues)
|
||||
{
|
||||
using (var outstream = new StreamWriter(fileName))
|
||||
{
|
||||
// TODO: No longer valid to check for leading MatterControl. token
|
||||
foreach (var key in PrinterSettings.KnownSettings.Where(k => !k.StartsWith("MatterControl.")))
|
||||
{
|
||||
string activeValue = printerSettings.GetValue(key);
|
||||
if (replaceMacroValues)
|
||||
{
|
||||
activeValue = GCodeProcessing.ReplaceMacroValues(activeValue);
|
||||
}
|
||||
outstream.Write(string.Format("{0} = {1}\n", key, activeValue));
|
||||
activeValue = GCodeProcessing.ReplaceMacroValues(activeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ExportAsCuraConfig()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ of the authors and should not be interpreted as representing official policies,
|
|||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.VectorMath;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -42,12 +42,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
private HashSet<string> matterSliceSettingNames;
|
||||
|
||||
private MappedSetting[] matterSliceSettings;
|
||||
private MappedSetting[] mappedSettings;
|
||||
|
||||
// Singleton use only - prevent external construction
|
||||
private EngineMappingsMatterSlice() : base("MatterSlice")
|
||||
{
|
||||
matterSliceSettings = new MappedSetting[]
|
||||
mappedSettings = new MappedSetting[]
|
||||
{
|
||||
new AsCountOrDistance("bottom_solid_layers", "numberOfBottomLayers", SettingsKey.layer_height),
|
||||
new AsCountOrDistance("perimeters", "numberOfPerimeters", SettingsKey.nozzle_diameter),
|
||||
|
|
@ -137,20 +137,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
new VisibleButNotMappedToEngine("solid_shell"),
|
||||
};
|
||||
|
||||
matterSliceSettingNames = new HashSet<string>(matterSliceSettings.Select(m => m.CanonicalSettingsName));
|
||||
matterSliceSettingNames = new HashSet<string>(mappedSettings.Select(m => m.CanonicalSettingsName));
|
||||
}
|
||||
|
||||
public override bool MapContains(string canonicalSettingsName)
|
||||
{
|
||||
return matterSliceSettingNames.Contains(canonicalSettingsName)
|
||||
|| base.applicationLevelSettings.Contains(canonicalSettingsName);
|
||||
}
|
||||
|
||||
public static void WriteMatterSliceSettingsFile(string outputFilename)
|
||||
public static void WriteSliceSettingsFile(string outputFilename)
|
||||
{
|
||||
using (StreamWriter sliceSettingsFile = new StreamWriter(outputFilename))
|
||||
{
|
||||
foreach (MappedSetting mappedSetting in Instance.matterSliceSettings)
|
||||
foreach (MappedSetting mappedSetting in Instance.mappedSettings)
|
||||
{
|
||||
if (mappedSetting.Value != null)
|
||||
{
|
||||
|
|
@ -160,6 +154,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
public override bool MapContains(string canonicalSettingsName)
|
||||
{
|
||||
return matterSliceSettingNames.Contains(canonicalSettingsName)
|
||||
|| base.applicationLevelSettings.Contains(canonicalSettingsName);
|
||||
}
|
||||
|
||||
public class ExtruderOffsets : MappedSetting
|
||||
{
|
||||
public ExtruderOffsets(string canonicalSettingsName, string exportedName)
|
||||
|
|
@ -218,6 +218,81 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
}
|
||||
|
||||
public class GCodeForSlicer : InjectGCodeCommands
|
||||
{
|
||||
public GCodeForSlicer(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value => GCodeProcessing.ReplaceMacroValues(base.Value.Replace("\n", "\\n"));
|
||||
}
|
||||
|
||||
public class InfillTranslator : MappedSetting
|
||||
{
|
||||
public InfillTranslator(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double infillRatio0To1 = ParseDouble(base.Value);
|
||||
// 400 = solid (extruder width)
|
||||
double nozzle_diameter = ParseDoubleFromRawValue(SettingsKey.nozzle_diameter);
|
||||
double linespacing = 1000;
|
||||
if (infillRatio0To1 > .01)
|
||||
{
|
||||
linespacing = nozzle_diameter / infillRatio0To1;
|
||||
}
|
||||
|
||||
return ((int)(linespacing * 1000)).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MapPositionToPlaceObjectCenter : MappedSetting
|
||||
{
|
||||
public MapPositionToPlaceObjectCenter(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector2 PrinteCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
|
||||
return "[{0},{1}]".FormatWith(PrinteCenter.x, PrinteCenter.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SkirtLengthMapping : MappedSetting
|
||||
{
|
||||
public SkirtLengthMapping(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double lengthToExtrudeMm = ParseDouble(base.Value);
|
||||
// we need to convert mm of filament to mm of extrusion path
|
||||
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.filament_diameter) * MathHelper.Tau * lengthToExtrudeMm;
|
||||
double extrusionSquareSize = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.first_layer_height) * ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.nozzle_diameter);
|
||||
double lineLength = amountOfFilamentCubicMms / extrusionSquareSize;
|
||||
|
||||
return lineLength.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SupportExtrusionWidth : MappedSetting
|
||||
{
|
||||
public SupportExtrusionWidth(string canonicalSettingsName, string exportedName)
|
||||
|
|
@ -267,80 +342,5 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
public override string Value => (ParseDouble(base.Value) + constant).ToString();
|
||||
}
|
||||
|
||||
public class InfillTranslator : MappedSetting
|
||||
{
|
||||
public InfillTranslator(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double infillRatio0To1 = ParseDouble(base.Value);
|
||||
// 400 = solid (extruder width)
|
||||
double nozzle_diameter = ParseDoubleFromRawValue(SettingsKey.nozzle_diameter);
|
||||
double linespacing = 1000;
|
||||
if (infillRatio0To1 > .01)
|
||||
{
|
||||
linespacing = nozzle_diameter / infillRatio0To1;
|
||||
}
|
||||
|
||||
return ((int)(linespacing * 1000)).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GCodeForSlicer : InjectGCodeCommands
|
||||
{
|
||||
public GCodeForSlicer(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value => GCodeProcessing.ReplaceMacroValues(base.Value.Replace("\n", "\\n"));
|
||||
}
|
||||
|
||||
public class MapPositionToPlaceObjectCenter : MappedSetting
|
||||
{
|
||||
public MapPositionToPlaceObjectCenter(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector2 PrinteCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
|
||||
return "[{0},{1}]".FormatWith(PrinteCenter.x, PrinteCenter.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SkirtLengthMapping : MappedSetting
|
||||
{
|
||||
public SkirtLengthMapping(string canonicalSettingsName, string exportedName)
|
||||
: base(canonicalSettingsName, exportedName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
double lengthToExtrudeMm = ParseDouble(base.Value);
|
||||
// we need to convert mm of filament to mm of extrusion path
|
||||
double amountOfFilamentCubicMms = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.filament_diameter) * MathHelper.Tau * lengthToExtrudeMm;
|
||||
double extrusionSquareSize = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.first_layer_height) * ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.nozzle_diameter);
|
||||
double lineLength = amountOfFilamentCubicMms / extrusionSquareSize;
|
||||
|
||||
return lineLength.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,61 +28,100 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MatterHackers.Agg;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
public class Slic3rEngineMappings : SliceEngineMapping
|
||||
{
|
||||
public static readonly Slic3rEngineMappings Instance = new Slic3rEngineMappings();
|
||||
|
||||
private List<string> hiddenSettings = null;
|
||||
private List<MappedSetting> mappedSettings = new List<MappedSetting>();
|
||||
private HashSet<string> slic3rSliceSettingNames;
|
||||
|
||||
// Singleton use only - prevent external construction
|
||||
private Slic3rEngineMappings() : base ("Slic3r")
|
||||
private Slic3rEngineMappings() : base("Slic3r")
|
||||
{
|
||||
hiddenSettings = new List<string>();
|
||||
hiddenSettings.Add("cool_extruder_lift");
|
||||
hiddenSettings.Add("support_material_create_internal_support");
|
||||
hiddenSettings.Add("support_material_create_perimeter");
|
||||
hiddenSettings.Add("min_extrusion_before_retract");
|
||||
hiddenSettings.Add("support_material_xy_distance");
|
||||
hiddenSettings.Add("support_material_z_distance");
|
||||
hiddenSettings.Add(SettingsKey.center_part_on_bed);
|
||||
hiddenSettings.Add(SettingsKey.expand_thin_walls);
|
||||
hiddenSettings.Add(SettingsKey.merge_overlapping_lines);
|
||||
hiddenSettings.Add(SettingsKey.fill_thin_gaps);
|
||||
hiddenSettings.Add("infill_overlap_perimeter");
|
||||
hiddenSettings.Add("support_type");
|
||||
hiddenSettings.Add("infill_type");
|
||||
hiddenSettings.Add("create_raft");
|
||||
hiddenSettings.Add("z_gap");
|
||||
hiddenSettings.Add(SettingsKey.bottom_clip_amount);
|
||||
hiddenSettings.Add("gcode_output_type");
|
||||
hiddenSettings.Add("raft_extra_distance_around_part");
|
||||
hiddenSettings.Add("output_only_first_layer");
|
||||
hiddenSettings.Add("raft_air_gap");
|
||||
hiddenSettings.Add("support_air_gap");
|
||||
hiddenSettings.Add("repair_outlines_extensive_stitching");
|
||||
hiddenSettings.Add("repair_outlines_keep_open");
|
||||
hiddenSettings.Add("complete_objects");
|
||||
hiddenSettings.Add("output_filename_format");
|
||||
hiddenSettings.Add("support_material_percent");
|
||||
hiddenSettings.Add("post_process");
|
||||
hiddenSettings.Add("extruder_clearance_height");
|
||||
hiddenSettings.Add("extruder_clearance_radius");
|
||||
hiddenSettings.Add("wipe_shield_distance");
|
||||
hiddenSettings.Add(SettingsKey.heat_extruder_before_homing);
|
||||
hiddenSettings.Add("extruders_share_temperature");
|
||||
hiddenSettings.Add("print_leveling_method");
|
||||
hiddenSettings.Add("solid_shell");
|
||||
hiddenSettings.Add("retractWhenChangingIslands");
|
||||
hiddenSettings.Add(SettingsKey.perimeter_start_end_overlap);
|
||||
foreach (var key in PrinterSettings.KnownSettings.Where(k => !k.StartsWith("MatterControl.")))
|
||||
{
|
||||
mappedSettings.Add(new MappedSetting(key, key));
|
||||
}
|
||||
|
||||
string[] hiddenSettings =
|
||||
{
|
||||
"cool_extruder_lift",
|
||||
"support_material_create_internal_support",
|
||||
"support_material_create_perimeter",
|
||||
"min_extrusion_before_retract",
|
||||
"support_material_xy_distance",
|
||||
"support_material_z_distance",
|
||||
SettingsKey.print_center,
|
||||
SettingsKey.expand_thin_walls,
|
||||
SettingsKey.merge_overlapping_lines,
|
||||
SettingsKey.fill_thin_gaps,
|
||||
"infill_overlap_perimeter",
|
||||
"support_type",
|
||||
"infill_type",
|
||||
"create_raft",
|
||||
"z_gap",
|
||||
SettingsKey.bottom_clip_amount,
|
||||
"gcode_output_type",
|
||||
"raft_extra_distance_around_part",
|
||||
"output_only_first_layer",
|
||||
"raft_air_gap",
|
||||
"support_air_gap",
|
||||
"repair_outlines_extensive_stitching",
|
||||
"repair_outlines_keep_open",
|
||||
"complete_objects",
|
||||
"output_filename_format",
|
||||
"support_material_percent",
|
||||
"post_process",
|
||||
"extruder_clearance_height",
|
||||
"extruder_clearance_radius",
|
||||
"wipe_shield_distance",
|
||||
SettingsKey.heat_extruder_before_homing,
|
||||
"extruders_share_temperature",
|
||||
"print_leveling_method",
|
||||
"solid_shell",
|
||||
"retractWhenChangingIslands",
|
||||
SettingsKey.perimeter_start_end_overlap,
|
||||
SettingsKey.bed_shape,
|
||||
};
|
||||
|
||||
foreach(string key in hiddenSettings)
|
||||
{
|
||||
for (int i = mappedSettings.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (mappedSettings[i].CanonicalSettingsName == key)
|
||||
{
|
||||
mappedSettings.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mappedSettings.Add(new Slice3rBedShape(SettingsKey.bed_shape));
|
||||
slic3rSliceSettingNames = new HashSet<string>(mappedSettings.Select(m => m.CanonicalSettingsName));
|
||||
}
|
||||
|
||||
public override bool MapContains(string key)
|
||||
public static void WriteSliceSettingsFile(string outputFilename)
|
||||
{
|
||||
// Visible items are anything not in hiddenSettings or that does not start with 'MatterControl.'
|
||||
return !hiddenSettings.Contains(key);
|
||||
using (StreamWriter sliceSettingsFile = new StreamWriter(outputFilename))
|
||||
{
|
||||
foreach (MappedSetting mappedSetting in Instance.mappedSettings)
|
||||
{
|
||||
if (mappedSetting.Value != null)
|
||||
{
|
||||
sliceSettingsFile.WriteLine("{0} = {1}".FormatWith(mappedSetting.ExportedName, mappedSetting.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool MapContains(string canonicalSettingsName)
|
||||
{
|
||||
return slic3rSliceSettingNames.Contains(canonicalSettingsName)
|
||||
|| base.applicationLevelSettings.Contains(canonicalSettingsName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,8 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.MeshVisualizer;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -115,6 +117,57 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
public virtual string Value => ActiveSliceSettings.Instance.GetValue(CanonicalSettingsName);
|
||||
}
|
||||
|
||||
public class Slice3rBedShape : MappedSetting
|
||||
{
|
||||
public Slice3rBedShape(string canonicalSettingsName)
|
||||
: base(canonicalSettingsName, canonicalSettingsName)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
Vector2 printCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
Vector2 bedSize = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.bed_size);
|
||||
switch (ActiveSliceSettings.Instance.GetValue<BedShape>(SettingsKey.bed_shape))
|
||||
{
|
||||
case BedShape.Circular:
|
||||
{
|
||||
int numPoints = 10;
|
||||
double angle = MathHelper.Tau / numPoints;
|
||||
string bedString = "";
|
||||
bool first = true;
|
||||
for (int i = 0; i < numPoints; i++)
|
||||
{
|
||||
if(!first)
|
||||
{
|
||||
bedString += ",";
|
||||
}
|
||||
double x = Math.Cos(angle*i);
|
||||
double y = Math.Sin(angle*i);
|
||||
bedString += $"{printCenter.x + x * bedSize.x / 2:0.####}x{printCenter.y + y * bedSize.y / 2:0.####}";
|
||||
first = false;
|
||||
}
|
||||
return bedString;
|
||||
}
|
||||
//bed_shape = 99.4522x10.4528,97.8148x20.7912,95.1057x30.9017,91.3545x40.6737,86.6025x50,80.9017x58.7785,74.3145x66.9131,66.9131x74.3145,58.7785x80.9017,50x86.6025,40.6737x91.3545,30.9017x95.1057,20.7912x97.8148,10.4528x99.4522,0x100,-10.4528x99.4522,-20.7912x97.8148,-30.9017x95.1057,-40.6737x91.3545,-50x86.6025,-58.7785x80.9017,-66.9131x74.3145,-74.3145x66.9131,-80.9017x58.7785,-86.6025x50,-91.3545x40.6737,-95.1057x30.9017,-97.8148x20.7912,-99.4522x10.4528,-100x0,-99.4522x - 10.4528,-97.8148x - 20.7912,-95.1057x - 30.9017,-91.3545x - 40.6737,-86.6025x - 50,-80.9017x - 58.7785,-74.3145x - 66.9131,-66.9131x - 74.3145,-58.7785x - 80.9017,-50x - 86.6025,-40.6737x - 91.3545,-30.9017x - 95.1057,-20.7912x - 97.8148,-10.4528x - 99.4522,0x - 100,10.4528x - 99.4522,20.7912x - 97.8148,30.9017x - 95.1057,40.6737x - 91.3545,50x - 86.6025,58.7785x - 80.9017,66.9131x - 74.3145,74.3145x - 66.9131,80.9017x - 58.7785,86.6025x - 50,91.3545x - 40.6737,95.1057x - 30.9017,97.8148x - 20.7912,99.4522x - 10.4528,100x0
|
||||
|
||||
case BedShape.Rectangular:
|
||||
default:
|
||||
{
|
||||
//bed_shape = 0x0,200x0,200x200,0x200
|
||||
string bedString = $"{printCenter.x - bedSize.x / 2}x{printCenter.y - bedSize.y / 2}";
|
||||
bedString += $",{printCenter.x + bedSize.x / 2}x{printCenter.y - bedSize.y / 2}";
|
||||
bedString += $",{printCenter.x + bedSize.x / 2}x{printCenter.y + bedSize.y / 2}";
|
||||
bedString += $",{printCenter.x - bedSize.x / 2}x{printCenter.y + bedSize.y / 2}";
|
||||
return bedString;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MapFirstValue : MappedSetting
|
||||
{
|
||||
public MapFirstValue(string canonicalSettingsName, string exportedName)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.SlicerConfiguration
|
||||
{
|
||||
|
|
@ -323,7 +325,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
return extruder1StlFileToSlice;
|
||||
}
|
||||
|
||||
public static bool runInProcess = false;
|
||||
public static bool runInProcess = true;
|
||||
private static Process slicerProcess = null;
|
||||
|
||||
private static void CreateSlicedPartsThread()
|
||||
|
|
@ -346,7 +348,6 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
itemToSlice.CurrentlySlicing = true;
|
||||
|
||||
string currentConfigurationFileAndPath = Path.Combine(ApplicationDataStorage.Instance.GCodeOutputPath, "config_" + ActiveSliceSettings.Instance.GetLongHashCode().ToString() + ".ini");
|
||||
ActiveSliceSettings.Instance.Helpers.GenerateConfigFile(currentConfigurationFileAndPath, true);
|
||||
|
||||
string gcodePathAndFileName = itemToSlice.GetGCodePathAndFileName();
|
||||
bool gcodeFileIsComplete = itemToSlice.IsGCodeFileComplete(gcodePathAndFileName);
|
||||
|
|
@ -358,7 +359,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
switch (ActiveSliceSettings.Instance.Helpers.ActiveSliceEngineType())
|
||||
{
|
||||
case SlicingEngineTypes.Slic3r:
|
||||
commandArgs = "--load \"" + currentConfigurationFileAndPath + "\" --output \"" + gcodePathAndFileName + "\" \"" + fileToSlice + "\"";
|
||||
Slic3rEngineMappings.WriteSliceSettingsFile(currentConfigurationFileAndPath);
|
||||
// if we have centering turend on and are printing a model loaded up from meshes (not gcode)
|
||||
if(ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.center_part_on_bed))
|
||||
{
|
||||
// figure out the center position of this file
|
||||
Vector2 bedCenter = ActiveSliceSettings.Instance.GetValue<Vector2>(SettingsKey.print_center);
|
||||
commandArgs = $"--print-center {bedCenter.x:0.##},{bedCenter.y:0.##} " + "--load \"" + currentConfigurationFileAndPath + "\" --output \"" + gcodePathAndFileName + "\" \"" + fileToSlice + "\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
commandArgs = "--load \"" + currentConfigurationFileAndPath + "\" --output \"" + gcodePathAndFileName + "\" \"" + fileToSlice + "\"";
|
||||
}
|
||||
break;
|
||||
|
||||
case SlicingEngineTypes.CuraEngine:
|
||||
|
|
@ -367,7 +379,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
case SlicingEngineTypes.MatterSlice:
|
||||
{
|
||||
EngineMappingsMatterSlice.WriteMatterSliceSettingsFile(currentConfigurationFileAndPath);
|
||||
EngineMappingsMatterSlice.WriteSliceSettingsFile(currentConfigurationFileAndPath);
|
||||
if (mergeRules == "")
|
||||
{
|
||||
commandArgs = "-v -o \"" + gcodePathAndFileName + "\" -c \"" + currentConfigurationFileAndPath + "\"";
|
||||
|
|
|
|||
|
|
@ -5848,3 +5848,6 @@ Translated:Clear ZOffset
|
|||
English:Printing Window...
|
||||
Translated:Printing Window...
|
||||
|
||||
English:Only Retract When Crossing Perimeters
|
||||
Translated:Only Retract When Crossing Perimeters
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue