1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
<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.

Hollow areas will become solid."
Content="Repair resin traps"
/>
<!-- Remove empty layers -->
<CheckBox
IsChecked="{Binding Operation.RemoveEmptyLayers}"
ToolTip.Tip="If enabled, repair will remove all layers with no white pixels.

The model will be recalculated to ensure the correct Z height is maintained."
Content="Remove empty layers"
/>
</StackPanel>
<Grid ColumnDefinitions="Auto,10,150,5,Auto"
RowDefinitions="Auto,10,Auto,10,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.

Islands remaining after repair will require supports to be added manually.

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"
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.

Islands remaining after repair will require supports to be added manually.

NOTE: This repair method requires the issues to be manually computed before hand."
Value="{Binding Operation.RemoveIslandsBelowEqualPixelCount}"
/>
<TextBlock
Grid.Row="0"
Grid.Column="4"
VerticalAlignment="Center"
IsEnabled="{Binding Operation.RepairIslands}"
Text="px"/>
<!-- 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.

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.

NOTE: Use with caution as this can remove large portions of your model if proper supports have not been added beforehand.

This repair method requires the issues to be manually computed before hand.

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"
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.

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.

NOTE: Use with caution as this can remove large portions of your model if proper supports have not been added beforehand.

This repair method requires the issues to be manually computed before hand.

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.

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.

This repair method requires the issues to be manually computed before hand.

Use 0 to disable this repair method."
Text="Attempt to attach islands down to:"/>
<NumericUpDown
Grid.Row="4"
Grid.Column="2"
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.

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.

This repair method requires the issues to be manually computed before hand.

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"/>
</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.

If enabled, gap closing is attempted before island removal is attempted.

Set iterations to 0 to disable.

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.

If enabled, gap closing is attempted before island removal is attempted.

Set iterations to 0 to disable.

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.

This settings can remove noise from a layer, but will also remove fine details.

Set iterations to 0 to disable.

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.

This settings can remove noise from a layer, but will also remove fine details.

Set iterations to 0 to disable.

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>
|