Files
UVtools/UVtools.WPF/Controls/Tools/ToolRepairLayersControl.axaml
T
2021-09-17 23:28:39 +01:00

224 lines
11 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
MinWidth="550"
x:Class="UVtools.WPF.Controls.Tools.ToolRepairLayersControl">
<StackPanel Orientation="Vertical" Spacing="10">
<StackPanel Orientation="Horizontal" Spacing="20">
<!-- Repair islands -->
<CheckBox
IsChecked="{Binding Operation.RepairIslands}"
ToolTip.Tip="If enabled, repair will first attempt to eliminate islands smaller than the pixel area removal threshold, and then runs the “gap closure” technique."
Content="Repair islands"/>
<!-- Repair resin traps -->
<CheckBox
IsChecked="{Binding Operation.RepairResinTraps}"
ToolTip.Tip="If enabled, repair will fill black pixels found within a resin trap with white pixels.
&#x0a;Hollow areas will become solid."
Content="Repair resin traps"/>
<!-- Repair resin traps -->
<CheckBox
IsChecked="{Binding Operation.RepairSuctionCups}"
ToolTip.Tip="If enabled, repair will drill suction cup layers with a vertical hole at the specified size."
Content="Repair suction cups"/>
<!-- Remove empty layers -->
<CheckBox
IsChecked="{Binding Operation.RemoveEmptyLayers}"
ToolTip.Tip="If enabled, repair will remove all layers with no white pixels.
&#x0a;The model will be recalculated to ensure the correct Z height is maintained."
Content="Remove empty layers"/>
</StackPanel>
<Grid RowDefinitions="Auto,10,Auto,10,Auto,10,Auto,10,Auto" ColumnDefinitions="Auto,10,190,5,Auto">
<!-- Remove islands equal or smaller than -->
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairIslands}"
ToolTip.Tip="The pixel area threshold above which islands will not be removed by this repair.
&#x0a;Islands remaining after repair will require supports to be added manually.
&#x0a;NOTE: This repair method requires the issues to be manually computed before hand."
Text="Remove islands equal or smaller than:"/>
<NumericUpDown Grid.Row="0" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
Increment="1"
Minimum="0"
Maximum="65535"
IsEnabled="{Binding Operation.RepairIslands}"
ToolTip.Tip="The pixel area threshold above which islands will not be removed by this repair.
&#x0a;Islands remaining after repair will require supports to be added manually.
&#x0a;NOTE: This repair method requires the issues to be manually computed before hand."
Value="{Binding Operation.RemoveIslandsBelowEqualPixelCount}"/>
<!-- Recursively remove islands for up to -->
<TextBlock Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairIslands}"
ToolTip.Tip="If the removal of an island in the current layer results in a new island being introduce in the layer above, the island in the layer above will also be automatically removed.
&#x0a;This process will repeat for up to the number of layers specified. Set to 0 to repeat until there are no more valid islands to remove.
&#x0a;NOTE: Use with caution as this can remove large portions of your model if proper supports have not been added beforehand.
&#x0a;This repair method requires the issues to be manually computed before hand.
&#x0a;Using this function with high values can be extremely slow depending on resolution and issue count."
Text="Recursively remove islands for up to:"/>
<NumericUpDown Grid.Row="2" Grid.Column="2"
Classes="ValueLabel ValueLabel_layers"
Increment="1"
Minimum="0"
Maximum="65535"
IsEnabled="{Binding Operation.RepairIslands}"
ToolTip.Tip="If the removal of an island in the current layer results in a new island being introduce in the layer above, the island in the layer above will also be automatically removed.
&#x0a;This process will repeat for up to the number of layers specified. Set to 0 to repeat until there are no more valid islands to remove.
&#x0a;NOTE: Use with caution as this can remove large portions of your model if proper supports have not been added beforehand.
&#x0a;This repair method requires the issues to be manually computed before hand.
&#x0a;Using this function with high values can be extremely slow depending on resolution and issue count."
Value="{Binding Operation.RemoveIslandsRecursiveIterations}"/>
<TextBlock Grid.Row="2" Grid.Column="4"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairIslands}"
Text="layers"/>
<!-- Attempt to attach islands below -->
<TextBlock Grid.Row="4" Grid.Column="0"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairIslands}"
ToolTip.Tip="Attempt to attach the islands down to n layers when found a safe mass below to support it.
&#x0a;NOTE: Use with caution and with a low value, this can mostly be used when there are some missed support layers in between as observed from the issues.
&#x0a;This repair method requires the issues to be manually computed before hand.
&#x0a;Use 0 to disable this repair method."
Text="Attempt to attach islands down to:"/>
<NumericUpDown Grid.Row="4" Grid.Column="2"
Classes="ValueLabel ValueLabel_layers"
Increment="1"
Minimum="0"
Maximum="65535"
IsEnabled="{Binding Operation.RepairIslands}"
ToolTip.Tip="Attempt to attach the islands down to n layers when found a safe mass below to support it.
&#x0a;NOTE: Use with caution and with a low value, this can mostly be used when there are some missed support layers in between as observed from the issues.
&#x0a;This repair method requires the issues to be manually computed before hand.
&#x0a;Use 0 to disable this repair method."
Value="{Binding Operation.AttachIslandsBelowLayers}"/>
<TextBlock Grid.Row="4" Grid.Column="4"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairIslands}"
Text="layers"/>
<!-- Overlap resin traps -->
<TextBlock Grid.Row="6" Grid.Column="0"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairResinTraps}"
ToolTip.Tip="Overlap and expand resin trap area by this value.
&#x0a;Use this field when you have aggressive blur on model and a visible margin between white pixels and the resin trap highlight area.
&#x0a;(0 = Fill the found area without overlap nearby pixels)"
Text="Overlap and expand resin traps by:"/>
<NumericUpDown Grid.Row="6" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
Increment="1"
Minimum="0"
Maximum="65535"
IsEnabled="{Binding Operation.RepairResinTraps}"
ToolTip.Tip="Overlap and expand resin trap area by this value.
&#x0a;Use this field when you have aggressive blur on model and a visible margin between white pixels and the resin trap highlight area.
&#x0a;(0 = Fill the found area without overlap nearby pixels)"
Value="{Binding Operation.ResinTrapsOverlapBy}"/>
<!-- Suction cup vent hole -->
<TextBlock Grid.Row="8" Grid.Column="0"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairSuctionCups}"
ToolTip.Tip="Hole diameter to drill the layers with"
Text="Suction cup vent hole diameter:"/>
<NumericUpDown Grid.Row="8" Grid.Column="2"
Classes="ValueLabel ValueLabel_px"
Increment="1"
Minimum="4"
Maximum="255"
IsEnabled="{Binding Operation.RepairSuctionCups}"
ToolTip.Tip="Hole diameter to drill the layers with"
Value="{Binding Operation.SuctionCupsVentHole}"/>
</Grid>
<Grid
IsVisible="{Binding ParentWindow.IsCheckBox1Checked}"
RowDefinitions="Auto,10,Auto"
ColumnDefinitions="Auto,10,155">
<!-- Gap closing iterations -->
<TextBlock
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center"
ToolTip.Tip="Attempt to repair islands by attaching them to other nearby islands in safe increments.
&#x0a;If enabled, gap closing is attempted before island removal is attempted.
&#x0a;Set iterations to 0 to disable.
&#x0a;WARNING: Using high iteration values can destroy your model. Low values recommended."
Text="Gap closing iterations:"/>
<NumericUpDown
Grid.Row="0"
Grid.Column="2"
Increment="1"
Minimum="0"
Maximum="255"
ToolTip.Tip="Attempt to repair islands by attaching them to other nearby islands in safe increments.
&#x0a;If enabled, gap closing is attempted before island removal is attempted.
&#x0a;Set iterations to 0 to disable.
&#x0a;WARNING: Using high iteration values can destroy your model. Low values recommended."
Value="{Binding Operation.GapClosingIterations}"
/>
<!-- Noise removal iterations: -->
<TextBlock
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
ToolTip.Tip="Remove individual or small clusters of pixels in iterations.
&#x0a;This settings can remove noise from a layer, but will also remove fine details.
&#x0a;Set iterations to 0 to disable.
&#x0a;WARNING: Even at low settings this operation has the potential to introduce new islands, as it may remove supporting material from previous layers."
Text="Noise removal iterations:"/>
<NumericUpDown
Grid.Row="2"
Grid.Column="2"
Increment="1"
Minimum="0"
Maximum="255"
ToolTip.Tip="Remove individual or small clusters of pixels in iterations.
&#x0a;This settings can remove noise from a layer, but will also remove fine details.
&#x0a;Set iterations to 0 to disable.
&#x0a;WARNING: Even at low settings this operation has the potential to introduce new islands, as it may remove supporting material from previous layers."
Value="{Binding Operation.NoiseRemovalIterations}"
/>
</Grid>
</StackPanel>
</UserControl>