From 307ddca93d8229a954b2b8ee3c51e00fe2f2c602 Mon Sep 17 00:00:00 2001 From: larsbrubaker Date: Sun, 19 Oct 2014 20:10:02 -0700 Subject: [PATCH] Made exporting to a single extruder put in all the meshes. Put in support extrusion width. --- .../SlicerMapping/EngineMappingMatterSlice.cs | 38 ++++++++++++++++- SlicerConfiguration/SlicingQueue.cs | 41 ++++++++++++++----- StaticData/SliceSettings/Properties.txt | 2 +- StaticData/Translations/Master.txt | 3 ++ 4 files changed, 72 insertions(+), 12 deletions(-) diff --git a/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs b/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs index beadeb6c9..edcb8ca8f 100644 --- a/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs +++ b/SlicerConfiguration/SlicerMapping/EngineMappingMatterSlice.cs @@ -237,7 +237,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration new ValuePlusConstant("supportExtruder", "support_material_extruder", -1), //supportLineSpacing=2 - new MapItem("supportLineSpacing", "support_material_spacing"), + new MapItem("supportLineSpacing", "support_material_spacing"), + + new SupportExtrusionWidth("supportExtrusionPercent","support_material_extrusion_width"), //supportMaterialSpeed=50 # mm/s. new MapItem("supportMaterialSpeed", "support_material_speed"), @@ -451,6 +453,40 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } + public class SupportExtrusionWidth : MapItem + { + public SupportExtrusionWidth(string mappedKey, string originalKey) + : base(mappedKey, originalKey) + { + } + + public override string MappedValue + { + get + { + double nozzleDiameter = ActiveSliceSettings.Instance.NozzleDiameter; + if (OriginalValue == "0") + { + return "100"; + } + + if (OriginalValue.Contains("%")) + { + string withoutPercent = OriginalValue.Replace("%", ""); + return withoutPercent; + } + + double originalValue; + if (!double.TryParse(OriginalValue, out originalValue)) + { + originalValue = nozzleDiameter; + } + + return (originalValue / nozzleDiameter * 100).ToString(); + } + } + } + public class SupportMatterial : MapItem { public SupportMatterial(string mappedKey, string originalKey) diff --git a/SlicerConfiguration/SlicingQueue.cs b/SlicerConfiguration/SlicingQueue.cs index b53793f05..52d6b7d3d 100644 --- a/SlicerConfiguration/SlicingQueue.cs +++ b/SlicerConfiguration/SlicingQueue.cs @@ -175,22 +175,43 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { foreach (Mesh mesh in meshGroup.Meshes) { - MeshMaterialData material = MeshMaterialData.Get(mesh); - switch (material.MaterialIndex) + if (ActiveSliceSettings.Instance.ExtruderCount > 1) { - case 1: - extruder1Group[0].Meshes.Add(mesh); - break; + MeshMaterialData material = MeshMaterialData.Get(mesh); + switch (material.MaterialIndex) + { + case 1: + extruder1Group[0].Meshes.Add(mesh); + break; - case 2: - extruder2Group[0].Meshes.Add(mesh); - break; + case 2: + extruder2Group[0].Meshes.Add(mesh); + break; + + default: + extruder1Group[0].Meshes.Add(mesh); + break; + } + } + else + { + extruder1Group[0].Meshes.Add(mesh); } } } - string extruder1StlFileToSlice = SaveAndGetFilenameForExtruder(extruder1Group, 1); - if (extruder2Group.Count > 0) + string extruder1StlFileToSlice; + if (ActiveSliceSettings.Instance.ExtruderCount > 1) + { + extruder1StlFileToSlice = SaveAndGetFilenameForExtruder(extruder1Group, 1); + } + else + { + extruder1StlFileToSlice = SaveAndGetFilenameForExtruder(extruder1Group, -1); + } + if (extruder2Group.Count > 0 + && extruder2Group[0].Meshes != null + && extruder2Group[0].Meshes.Count > 0) { string extruder2StlFileToSlice = SaveAndGetFilenameForExtruder(extruder2Group, 2); return new string[] { extruder1StlFileToSlice, extruder2StlFileToSlice }; diff --git a/StaticData/SliceSettings/Properties.txt b/StaticData/SliceSettings/Properties.txt index f89118dee..35c7cc0ee 100644 --- a/StaticData/SliceSettings/Properties.txt +++ b/StaticData/SliceSettings/Properties.txt @@ -120,7 +120,7 @@ support_material_infill_angle|Infill Angle|POSITIVE_DOUBLE|degrees|The angle the support_material_create_internal_support|Support Everywhere|CHECK_BOX||If this is checked support will be allowed starting on top of internal surfaces. If it is not checked support will only be created starting at the bed. support_material_enforce_layers|Enforce Support For First|INT|layers|Generate support material everywhere not touching the bed for n layers, regardless of angle. support_material_extruder|Support Material Extruder|INT||The index of the extruder to use for support material. -support_material_extrusion_width|Support Material|DOUBLE_OR_PERCENT|mm or %\nleave 0 for default|Leave this as 0 to allow automatic calculation of extrusion width. +support_material_extrusion_width|Support Material|DOUBLE_OR_PERCENT|mm or %|You can specify the extrusion with or set this to a % of the main extrusion widthe. Leave this as 0 to allow automatic calculation. support_material_interface_extruder|Support Interface Extruder|INT||The index of the extruder to use for support material interface layers. support_material_interface_layers|Interface Layers|INT|layers|The number of layers to print between the supports and the part. support_material_interface_spacing|Interface Pattern Spacing|POSITIVE_DOUBLE|mm|The space between lines of the interface layers (0 is solid). diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 065a10698..a1e4c065e 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -2729,3 +2729,6 @@ Translated:Export... English:Temperature Translated:Temperature +English:You can specify the extrusion with or set this to a % of the main extrusion widthe. Leave this as 0 to allow automatic calculation. +Translated:You can specify the extrusion with or set this to a % of the main extrusion widthe. Leave this as 0 to allow automatic calculation. +