Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2020-10-13 04:04:05 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2020-10-13 04:04:05 +0300
commit1a0229a654c49385d9c757383d30f0d38882d3d7 (patch)
tree66deae60c2715c3c59df2e39a667f772fe9654cf /UVtools.GUI
parent4721a525653789f44615c7fe19433c570077a352 (diff)
v0.8.4.3v0.8.4.3
* (Add) Tool - Layer repair: Allow remove islands recursively (#74) * (Fix) Pixel Editor: Cursor dimentions when using brushes with thickness > 1 (#73)
Diffstat (limited to 'UVtools.GUI')
-rw-r--r--UVtools.GUI/App.config6
-rw-r--r--UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.Designer.cs62
-rw-r--r--UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.cs2
-rw-r--r--UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.resx14
-rw-r--r--UVtools.GUI/FrmMain.cs9
-rw-r--r--UVtools.GUI/Properties/AssemblyInfo.cs4
-rw-r--r--UVtools.GUI/Properties/Settings.Designer.cs12
-rw-r--r--UVtools.GUI/Properties/Settings.settings3
8 files changed, 97 insertions, 15 deletions
diff --git a/UVtools.GUI/App.config b/UVtools.GUI/App.config
index cea47d0..cc2e5e9 100644
--- a/UVtools.GUI/App.config
+++ b/UVtools.GUI/App.config
@@ -216,7 +216,8 @@
<setting name="LayerRepairRemoveEmptyLayers" serializeAs="String">
<value>True</value>
</setting>
- <setting name="LayerRepairRemoveIslandsBelowEqualPixelsDefault" serializeAs="String">
+ <setting name="LayerRepairRemoveIslandsBelowEqualPixelsDefault"
+ serializeAs="String">
<value>10</value>
</setting>
<setting name="PartialUpdateIslandsOnEditing" serializeAs="String">
@@ -267,6 +268,9 @@
<setting name="OverhangIndependentFromIslands" serializeAs="String">
<value>True</value>
</setting>
+ <setting name="LayerRepairRemoveIslandsRecursiveIterations" serializeAs="String">
+ <value>4</value>
+ </setting>
</UVtools.GUI.Properties.Settings>
</userSettings>
</configuration>
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.Designer.cs b/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.Designer.cs
index cd08105..24b0fe2 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.Designer.cs
+++ b/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.Designer.cs
@@ -40,10 +40,14 @@
this.cbRemoveEmptyLayers = new System.Windows.Forms.CheckBox();
this.cbRepairResinTraps = new System.Windows.Forms.CheckBox();
this.cbRepairIslands = new System.Windows.Forms.CheckBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.nmRemoveIslandsRecursiveIterations = new System.Windows.Forms.NumericUpDown();
+ this.label5 = new System.Windows.Forms.Label();
this.groupAdvancedSettings.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmOpeningIterations)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmClosingIterations)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmRemoveIslandsBelowEqualPixels)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.nmRemoveIslandsRecursiveIterations)).BeginInit();
this.SuspendLayout();
//
// groupAdvancedSettings
@@ -52,7 +56,7 @@
this.groupAdvancedSettings.Controls.Add(this.label1);
this.groupAdvancedSettings.Controls.Add(this.nmClosingIterations);
this.groupAdvancedSettings.Controls.Add(this.lbIterationsStart);
- this.groupAdvancedSettings.Location = new System.Drawing.Point(3, 87);
+ this.groupAdvancedSettings.Location = new System.Drawing.Point(3, 111);
this.groupAdvancedSettings.Name = "groupAdvancedSettings";
this.groupAdvancedSettings.Size = new System.Drawing.Size(601, 110);
this.groupAdvancedSettings.TabIndex = 31;
@@ -106,7 +110,7 @@
// label3
//
this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(319, 46);
+ this.label3.Location = new System.Drawing.Point(341, 46);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(25, 20);
this.label3.TabIndex = 30;
@@ -117,15 +121,16 @@
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 46);
this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(250, 20);
+ this.label2.Size = new System.Drawing.Size(276, 20);
this.label2.TabIndex = 29;
- this.label2.Text = "Do not remove islands larger than:";
+ this.label2.Text = "Remove islands equal or smaller than:";
this.toolTip.SetToolTip(this.label2, "The pixel area theshold above which islands will not be removed by this repair. " +
- " Islands remaining after repair will require supports to be added manually.");
+ " Islands remaining after repair will require supports to be added manually.\r\n0 =" +
+ " Disable: Do not remove any island");
//
// nmRemoveIslandsBelowEqualPixels
//
- this.nmRemoveIslandsBelowEqualPixels.Location = new System.Drawing.Point(259, 43);
+ this.nmRemoveIslandsBelowEqualPixels.Location = new System.Drawing.Point(281, 43);
this.nmRemoveIslandsBelowEqualPixels.Maximum = new decimal(new int[] {
255,
0,
@@ -135,7 +140,8 @@
this.nmRemoveIslandsBelowEqualPixels.Size = new System.Drawing.Size(58, 26);
this.nmRemoveIslandsBelowEqualPixels.TabIndex = 28;
this.toolTip.SetToolTip(this.nmRemoveIslandsBelowEqualPixels, "The pixel area theshold above which islands will not be removed by this repair. " +
- " Islands remaining after repair will require supports to be added manually.");
+ " Islands remaining after repair will require supports to be added manually.\r\n0 =" +
+ " Disable: Do not remove any island\r\n");
//
// cbRemoveEmptyLayers
//
@@ -179,12 +185,46 @@
" area removal threshold, and then runs the “gap closure” technique.\r\n");
this.cbRepairIslands.UseVisualStyleBackColor = true;
//
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(3, 77);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(265, 20);
+ this.label4.TabIndex = 32;
+ this.label4.Text = "Recursively remove islands for up to:";
+ this.toolTip.SetToolTip(this.label4, resources.GetString("label4.ToolTip"));
+ //
+ // nmRemoveIslandsRecursiveIterations
+ //
+ this.nmRemoveIslandsRecursiveIterations.Location = new System.Drawing.Point(281, 74);
+ this.nmRemoveIslandsRecursiveIterations.Maximum = new decimal(new int[] {
+ 65535,
+ 0,
+ 0,
+ 0});
+ this.nmRemoveIslandsRecursiveIterations.Name = "nmRemoveIslandsRecursiveIterations";
+ this.nmRemoveIslandsRecursiveIterations.Size = new System.Drawing.Size(58, 26);
+ this.nmRemoveIslandsRecursiveIterations.TabIndex = 33;
+ this.toolTip.SetToolTip(this.nmRemoveIslandsRecursiveIterations, resources.GetString("nmRemoveIslandsRecursiveIterations.ToolTip"));
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(341, 77);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(50, 20);
+ this.label5.TabIndex = 34;
+ this.label5.Text = "layers";
+ //
// CtrlToolRepairLayers
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
- this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.nmRemoveIslandsRecursiveIterations);
+ this.Controls.Add(this.label4);
this.Controls.Add(this.groupAdvancedSettings);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
@@ -197,12 +237,13 @@
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.LayerRangeVisible = false;
this.Name = "CtrlToolRepairLayers";
- this.Size = new System.Drawing.Size(607, 200);
+ this.Size = new System.Drawing.Size(607, 224);
this.groupAdvancedSettings.ResumeLayout(false);
this.groupAdvancedSettings.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nmOpeningIterations)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmClosingIterations)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmRemoveIslandsBelowEqualPixels)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.nmRemoveIslandsRecursiveIterations)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -221,5 +262,8 @@
private System.Windows.Forms.CheckBox cbRemoveEmptyLayers;
private System.Windows.Forms.CheckBox cbRepairResinTraps;
private System.Windows.Forms.CheckBox cbRepairIslands;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.NumericUpDown nmRemoveIslandsRecursiveIterations;
+ private System.Windows.Forms.Label label5;
}
}
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.cs b/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.cs
index c8fe8a9..f63bd8d 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.cs
+++ b/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.cs
@@ -25,6 +25,7 @@ namespace UVtools.GUI.Controls.Tools
cbRepairResinTraps.Checked = Properties.Settings.Default.LayerRepairResinTraps;
cbRemoveEmptyLayers.Checked = Properties.Settings.Default.LayerRepairRemoveEmptyLayers;
nmRemoveIslandsBelowEqualPixels.Value = Properties.Settings.Default.LayerRepairRemoveIslandsBelowEqualPixelsDefault;
+ nmRemoveIslandsRecursiveIterations.Value = Properties.Settings.Default.LayerRepairRemoveIslandsRecursiveIterations;
nmClosingIterations.Value = Properties.Settings.Default.LayerRepairDefaultClosingIterations;
nmOpeningIterations.Value = Properties.Settings.Default.LayerRepairDefaultOpeningIterations;
@@ -39,6 +40,7 @@ namespace UVtools.GUI.Controls.Tools
Operation.RepairResinTraps = cbRepairResinTraps.Checked;
Operation.RemoveEmptyLayers = cbRemoveEmptyLayers.Checked;
Operation.RemoveIslandsBelowEqualPixelCount = (byte) nmRemoveIslandsBelowEqualPixels.Value;
+ Operation.RemoveIslandsRecursiveIterations = (ushort) nmRemoveIslandsRecursiveIterations.Value;
Operation.GapClosingIterations = (uint) nmClosingIterations.Value;
Operation.NoiseRemovalIterations = (uint) nmOpeningIterations.Value;
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.resx b/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.resx
index 866a61d..e083b02 100644
--- a/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.resx
+++ b/UVtools.GUI/Controls/Tools/CtrlToolRepairLayers.resx
@@ -131,4 +131,18 @@ WARNING: Even at low settings this operation has the potential to introduce new
Set iterations to 0 to disable.
WARNING: Using high iteration values can destroy your model. Low values recomended.</value>
</data>
+ <data name="label4.ToolTip" xml:space="preserve">
+ <value>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.
+ Using this function with high values can be extremely slow depending on resolution and issue count.</value>
+ </data>
+ <data name="nmRemoveIslandsRecursiveIterations.ToolTip" xml:space="preserve">
+ <value>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.
+ Using this function with high values can be extremely slow depending on resolution and issue count.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs
index 0f6cd03..e6240de 100644
--- a/UVtools.GUI/FrmMain.cs
+++ b/UVtools.GUI/FrmMain.cs
@@ -4259,6 +4259,7 @@ namespace UVtools.GUI
{
// Tools
case OperationRepairLayers operation:
+ operation.IslandDetectionConfig = GetIslandDetectionConfiguration();
SlicerFile.LayerManager.RepairLayers(operation, FrmLoading.RestartProgress(operation.CanCancel));
break;
case OperationMove operation:
@@ -4378,7 +4379,9 @@ namespace UVtools.GUI
? 1
: nmPixelEditorDrawingThickness.Value);
- int diameter = (brushSize * pbLayer.Zoom / 100);
+
+ var cursorSize = thickness > 1 ? brushSize + thickness : brushSize;
+ int diameter = (int) (cursorSize * pbLayer.ZoomFactor);
if (brushSize > 1 && diameter >= _pixelEditorCursorMinDiamater)
{
bitmap = new Bitmap(diameter, diameter, PixelFormat.Format32bppArgb);
@@ -4392,7 +4395,7 @@ namespace UVtools.GUI
case PixelDrawing.BrushShapeType.Rectangle:
if (thickness >= 1)
{
- gr.DrawRectangle(new Pen(_pixelEditorCursorBrush, thickness), 0, 0, diameter, diameter);
+ gr.DrawRectangle(new Pen(_pixelEditorCursorBrush, (int)(thickness * 2 * pbLayer.ZoomFactor)), 0, 0, diameter, diameter);
}
else
{
@@ -4402,7 +4405,7 @@ namespace UVtools.GUI
case PixelDrawing.BrushShapeType.Circle:
if (thickness >= 1)
{
- gr.DrawEllipse(new Pen(_pixelEditorCursorBrush, thickness), 0, 0, diameter, diameter);
+ gr.DrawEllipse(new Pen(_pixelEditorCursorBrush, (int)(thickness * 2 * pbLayer.ZoomFactor)), 0, 0, diameter, diameter);
}
else
{
diff --git a/UVtools.GUI/Properties/AssemblyInfo.cs b/UVtools.GUI/Properties/AssemblyInfo.cs
index 20c38ad..36d551e 100644
--- a/UVtools.GUI/Properties/AssemblyInfo.cs
+++ b/UVtools.GUI/Properties/AssemblyInfo.cs
@@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.8.4.2")]
-[assembly: AssemblyFileVersion("0.8.4.2")]
+[assembly: AssemblyVersion("0.8.4.3")]
+[assembly: AssemblyFileVersion("0.8.4.3")]
diff --git a/UVtools.GUI/Properties/Settings.Designer.cs b/UVtools.GUI/Properties/Settings.Designer.cs
index 1e56ae5..1f91fc8 100644
--- a/UVtools.GUI/Properties/Settings.Designer.cs
+++ b/UVtools.GUI/Properties/Settings.Designer.cs
@@ -970,5 +970,17 @@ namespace UVtools.GUI.Properties {
this["OverhangIndependentFromIslands"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("4")]
+ public short LayerRepairRemoveIslandsRecursiveIterations {
+ get {
+ return ((short)(this["LayerRepairRemoveIslandsRecursiveIterations"]));
+ }
+ set {
+ this["LayerRepairRemoveIslandsRecursiveIterations"] = value;
+ }
+ }
}
}
diff --git a/UVtools.GUI/Properties/Settings.settings b/UVtools.GUI/Properties/Settings.settings
index 5cf1017..e25f334 100644
--- a/UVtools.GUI/Properties/Settings.settings
+++ b/UVtools.GUI/Properties/Settings.settings
@@ -239,5 +239,8 @@
<Setting Name="OverhangIndependentFromIslands" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
+ <Setting Name="LayerRepairRemoveIslandsRecursiveIterations" Type="System.Int16" Scope="User">
+ <Value Profile="(Default)">4</Value>
+ </Setting>
</Settings>
</SettingsFile> \ No newline at end of file