mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-20 07:26:26 +02:00
Add additional setting for Suction Cups to only report those over a certain height
This commit is contained in:
@@ -190,6 +190,12 @@ namespace UVtools.Core.Layers
|
||||
/// </summary>
|
||||
public uint RequiredAreaToConsiderSuctionCup { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Required minimum height (in mm) to be considered a suction cup
|
||||
/// </summary>
|
||||
public decimal RequiredHeightToConsiderSuctionCup { get; set; } = 0.5m;
|
||||
|
||||
|
||||
public ResinTrapDetectionConfiguration(bool enabled = true)
|
||||
{
|
||||
Enabled = enabled;
|
||||
|
||||
@@ -961,9 +961,15 @@ namespace UVtools.Core.Managers
|
||||
progress.LockAndIncrement();
|
||||
}
|
||||
|
||||
var minSuctionHeight = resinTrapConfig.RequiredHeightToConsiderSuctionCup;
|
||||
var minNumLayers = Math.Ceiling((minSuctionHeight / (decimal)SlicerFile.LayerHeight));
|
||||
|
||||
foreach (var group in suctionGroups)
|
||||
{
|
||||
AddIssue(new MainIssue(MainIssue.IssueType.SuctionCup, group));
|
||||
if (group.Count >= minNumLayers)
|
||||
{
|
||||
AddIssue(new MainIssue(MainIssue.IssueType.SuctionCup, group));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -698,7 +698,8 @@ namespace UVtools.WPF
|
||||
RequiredBlackPixelsToDrain = Settings.Issues.ResinTrapRequiredBlackPixelsToDrain,
|
||||
MaximumPixelBrightnessToDrain = Settings.Issues.ResinTrapMaximumPixelBrightnessToDrain,
|
||||
DetectSuctionCups = Settings.Issues.ComputeSuctionCups,
|
||||
RequiredAreaToConsiderSuctionCup = Settings.Issues.SuctionCupRequiredAreaToConsider
|
||||
RequiredAreaToConsiderSuctionCup = Settings.Issues.SuctionCupRequiredAreaToConsider,
|
||||
RequiredHeightToConsiderSuctionCup = Settings.Issues.SuctionCupRequiredHeightToConsider
|
||||
};
|
||||
}
|
||||
public ResinTrapDetectionConfiguration GetResinTrapDetectionConfiguration() => GetResinTrapDetectionConfiguration(Settings.Issues.ComputeResinTraps);
|
||||
|
||||
@@ -798,6 +798,7 @@ namespace UVtools.WPF
|
||||
private byte _resinTrapRequiredBlackPixelsToDrain = 10;
|
||||
private byte _resinTrapMaximumPixelBrightnessToDrain = 30;
|
||||
private uint _suctionCupRequiredAreaToConsider = 10000;
|
||||
private decimal _suctionCupRequiredHeightToConsider = 0.5m;
|
||||
private byte _touchingBoundMinimumPixelBrightness = 127;
|
||||
private byte _touchingBoundMarginLeft = 5;
|
||||
private byte _touchingBoundMarginTop = 5;
|
||||
@@ -968,6 +969,12 @@ namespace UVtools.WPF
|
||||
set => RaiseAndSetIfChanged(ref _suctionCupRequiredAreaToConsider, value);
|
||||
}
|
||||
|
||||
public decimal SuctionCupRequiredHeightToConsider
|
||||
{
|
||||
get => _suctionCupRequiredHeightToConsider;
|
||||
set => RaiseAndSetIfChanged(ref _suctionCupRequiredHeightToConsider, value);
|
||||
}
|
||||
|
||||
public byte TouchingBoundMinimumPixelBrightness
|
||||
{
|
||||
get => _touchingBoundMinimumPixelBrightness;
|
||||
|
||||
@@ -1315,6 +1315,18 @@
|
||||
Text="Bounding area required for an object to be processed during suction cup detection"
|
||||
ToolTip.Tip="Objects with bounding area smaller than this value will not be processed during suction cup detection."/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="10" Spacing="10">
|
||||
<NumericUpDown Width="60"
|
||||
Minimum="0.05"
|
||||
Maximum="4294967295"
|
||||
Increment="0.05"
|
||||
Value="{Binding Settings.Issues.SuctionCupRequiredHeightToConsider}"
|
||||
/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="Minimum height required (mm) for a suction cup detection to be reported"
|
||||
ToolTip.Tip="Objects with a smaller height than this value will not be reported during suction cup detection."/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user