Adding customizable probing bed inset

This commit is contained in:
Lars Brubaker 2021-05-13 10:38:42 -07:00
parent b5302eb1f4
commit 4500f0fa8b
6 changed files with 22 additions and 2 deletions

View file

@ -165,6 +165,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
SettingsKey.print_center,
SettingsKey.print_leveling_probe_start,
SettingsKey.print_leveling_required_to_print,
SettingsKey.print_leveling_insets,
SettingsKey.print_leveling_solution,
SettingsKey.print_time_estimate_multiplier,
SettingsKey.printer_name,

View file

@ -182,6 +182,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public const string print_leveling_probe_start = nameof(print_leveling_probe_start);
public const string print_leveling_required_to_print = nameof(print_leveling_required_to_print);
public const string print_leveling_solution = nameof(print_leveling_solution);
public const string print_leveling_insets = nameof(print_leveling_insets);
public const string print_time_estimate_multiplier = nameof(print_time_estimate_multiplier);
public const string printer_name = nameof(printer_name);
public const string probe_has_been_calibrated = nameof(probe_has_been_calibrated);

View file

@ -1075,6 +1075,18 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
RebuildGCodeOnChange = false
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.print_leveling_insets,
PresentationName = "Leveling Insets".Localize(),
HelpText = "The inset amount for each side of the bed.\n- As a % of the width or depth\n- Ordered: Left, Front, Right, Back\n- NOTE: The probe offset is added on top of this".Localize(),
DataEditType = DataEditTypes.BOUNDS,
Units = "%".Localize(),
ShowAsOverride = true,
ShowIfSet = "!has_hardware_leveling",
RebuildGCodeOnChange = false,
DefaultValue = "10,10,10,10"
},
new SliceSettingData()
{
SlicerConfigName = SettingsKey.leveling_sample_points,
PresentationName = "Sample Points".Localize(),

View file

@ -292,6 +292,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
("Leveling", new[]
{
SettingsKey.print_leveling_solution,
SettingsKey.print_leveling_insets,
SettingsKey.leveling_sample_points,
SettingsKey.print_leveling_required_to_print,
}),

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using MatterHackers.Agg;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.MeshVisualizer;
using MatterHackers.VectorMath;
@ -53,7 +54,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
{
AxisAlignedBoundingBox aabb = printer.Bed.Aabb;
aabb.Expand(aabb.XSize * -.1, aabb.YSize * -.1, 0);
var insets = printer.Settings.GetValue<Vector4>(SettingsKey.print_leveling_insets);
aabb.MinXYZ.X += aabb.XSize * insets[0] / 100.0;
aabb.MinXYZ.Y += aabb.YSize * insets[1] / 100.0;
aabb.MaxXYZ.X -= aabb.XSize * insets[2] / 100.0;
aabb.MaxXYZ.Y -= aabb.YSize * insets[3] / 100.0;
if (printer.Settings.GetValue<BedShape>(SettingsKey.bed_shape) == BedShape.Circular)
{

@ -1 +1 @@
Subproject commit 4c0f9c8cabf149ce6b4d70515b2a38c04483a72d
Subproject commit ef102435a4a6250caf7599fb6a889089b46a19b7