* (Change) Island detection system:
  * **Before**: A island is consider safe by just have a static amount of pixels, this mean it's possible to have a mass with 100000px supported by only 10px (If safe pixels are configured to this value), so there's no relation with island size and it supporting size. This leads to a big problem and not detecting some potential/unsafe islands.
  * **Now:** Instead of a static number of safe pixels, now there's a multiplier value, which will multiply the island total pixels per the multiplier, the supporting pixels count must be higher than the result of the multiplication.
    *  **Formula:** Supporting pixels >= Island pixels * multiplier
    *  **Example:** Multiplier of 0.25, an island with 1000px * 0.25 = 250px, so this island will not be considered if below exists at least 250px to support it, otherwise will be flagged as an island.
    *  **Notes:** This is a much more fair system but still not optimal, bridges and big planes with micro supports can trigger false islands. While this is a improvement over old system it's not perfect and you probably will have islands which you must ignore. Renember that you not have to clear out the issue list! Simply step over and ignore the issues you think are false-positives.
This commit is contained in:
Tiago Conceição
2020-10-17 04:34:17 +01:00
parent 52e002e8d0
commit d709cdda41
16 changed files with 139 additions and 58 deletions
+42 -34
View File
@@ -55,7 +55,7 @@
this.label10 = new System.Windows.Forms.Label();
this.nmIslandRequiredPixelBrightnessToSupport = new System.Windows.Forms.NumericUpDown();
this.label9 = new System.Windows.Forms.Label();
this.nmIslandRequiredPixelsToSupport = new System.Windows.Forms.NumericUpDown();
this.nmIslandRequiredPixelsToSupportMultiplier = new System.Windows.Forms.NumericUpDown();
this.nmIslandRequiredAreaToProcessCheck = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
@@ -93,6 +93,7 @@
this.label27 = new System.Windows.Forms.Label();
this.tbFileSaveNamePreffix = new System.Windows.Forms.TextBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.cbLoadDemoFileOnStartup = new System.Windows.Forms.CheckBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.cbLayerAutoRotateBestView = new System.Windows.Forms.CheckBox();
@@ -187,7 +188,6 @@
this.cbLayerRepairLayersIslands = new System.Windows.Forms.CheckBox();
this.pnActions = new System.Windows.Forms.Panel();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.cbLoadDemoFileOnStartup = new System.Windows.Forms.CheckBox();
this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmResinTrapBinaryThreshold)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmResinTrapMaximumPixelBrightnessToDrain)).BeginInit();
@@ -196,7 +196,7 @@
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nmIslandBinaryThreshold)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelBrightnessToSupport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelsToSupport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelsToSupportMultiplier)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredAreaToProcessCheck)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelBrightnessToProcessCheck)).BeginInit();
this.groupBox1.SuspendLayout();
@@ -480,7 +480,7 @@
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.nmIslandRequiredPixelBrightnessToSupport);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.nmIslandRequiredPixelsToSupport);
this.groupBox2.Controls.Add(this.nmIslandRequiredPixelsToSupportMultiplier);
this.groupBox2.Controls.Add(this.nmIslandRequiredAreaToProcessCheck);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label8);
@@ -568,33 +568,41 @@
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(73, 148);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(432, 18);
this.label9.Size = new System.Drawing.Size(420, 18);
this.label9.TabIndex = 23;
this.label9.Text = "Supporting safe pixels required to considerer an island supported\r\n";
this.toolTip.SetToolTip(this.label9, resources.GetString("label9.ToolTip"));
this.label9.Text = "Supporting safe pixels required over a multiplier on island pixels";
this.toolTip.SetToolTip(this.label9, "An island supported by at least it pixels multiplied by this value will always be" +
" considered supported.\r\nFormula: Supporting pixels >= Island pixels * this value" +
"");
//
// nmIslandRequiredPixelsToSupport
// nmIslandRequiredPixelsToSupportMultiplier
//
this.nmIslandRequiredPixelsToSupport.Location = new System.Drawing.Point(10, 145);
this.nmIslandRequiredPixelsToSupport.Maximum = new decimal(new int[] {
255,
this.nmIslandRequiredPixelsToSupportMultiplier.DecimalPlaces = 2;
this.nmIslandRequiredPixelsToSupportMultiplier.Increment = new decimal(new int[] {
5,
0,
0,
0});
this.nmIslandRequiredPixelsToSupport.Minimum = new decimal(new int[] {
1,
131072});
this.nmIslandRequiredPixelsToSupportMultiplier.Location = new System.Drawing.Point(10, 145);
this.nmIslandRequiredPixelsToSupportMultiplier.Maximum = new decimal(new int[] {
95,
0,
0,
0});
this.nmIslandRequiredPixelsToSupport.Name = "nmIslandRequiredPixelsToSupport";
this.nmIslandRequiredPixelsToSupport.Size = new System.Drawing.Size(57, 24);
this.nmIslandRequiredPixelsToSupport.TabIndex = 22;
this.toolTip.SetToolTip(this.nmIslandRequiredPixelsToSupport, "Range 1-255");
this.nmIslandRequiredPixelsToSupport.Value = new decimal(new int[] {
1,
131072});
this.nmIslandRequiredPixelsToSupportMultiplier.Minimum = new decimal(new int[] {
5,
0,
0,
0});
131072});
this.nmIslandRequiredPixelsToSupportMultiplier.Name = "nmIslandRequiredPixelsToSupportMultiplier";
this.nmIslandRequiredPixelsToSupportMultiplier.Size = new System.Drawing.Size(57, 24);
this.nmIslandRequiredPixelsToSupportMultiplier.TabIndex = 22;
this.toolTip.SetToolTip(this.nmIslandRequiredPixelsToSupportMultiplier, "Range 0.05-0.95");
this.nmIslandRequiredPixelsToSupportMultiplier.Value = new decimal(new int[] {
50,
0,
0,
131072});
//
// nmIslandRequiredAreaToProcessCheck
//
@@ -1032,6 +1040,16 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Startup";
//
// cbLoadDemoFileOnStartup
//
this.cbLoadDemoFileOnStartup.AutoSize = true;
this.cbLoadDemoFileOnStartup.Location = new System.Drawing.Point(6, 79);
this.cbLoadDemoFileOnStartup.Name = "cbLoadDemoFileOnStartup";
this.cbLoadDemoFileOnStartup.Size = new System.Drawing.Size(361, 22);
this.cbLoadDemoFileOnStartup.TabIndex = 8;
this.cbLoadDemoFileOnStartup.Text = "Loads a demo file on startup if no file was specified";
this.cbLoadDemoFileOnStartup.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.groupBox9);
@@ -2334,16 +2352,6 @@
this.toolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
this.toolTip.ToolTipTitle = "Information";
//
// cbLoadDemoFileOnStartup
//
this.cbLoadDemoFileOnStartup.AutoSize = true;
this.cbLoadDemoFileOnStartup.Location = new System.Drawing.Point(6, 79);
this.cbLoadDemoFileOnStartup.Name = "cbLoadDemoFileOnStartup";
this.cbLoadDemoFileOnStartup.Size = new System.Drawing.Size(361, 22);
this.cbLoadDemoFileOnStartup.TabIndex = 8;
this.cbLoadDemoFileOnStartup.Text = "Loads a demo file on startup if no file was specified";
this.cbLoadDemoFileOnStartup.UseVisualStyleBackColor = true;
//
// FrmSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -2371,7 +2379,7 @@
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nmIslandBinaryThreshold)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelBrightnessToSupport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelsToSupport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelsToSupportMultiplier)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredAreaToProcessCheck)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nmIslandRequiredPixelBrightnessToProcessCheck)).EndInit();
this.groupBox1.ResumeLayout(false);
@@ -2432,7 +2440,7 @@
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.NumericUpDown nmIslandRequiredPixelsToSupport;
private System.Windows.Forms.NumericUpDown nmIslandRequiredPixelsToSupportMultiplier;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.NumericUpDown nmIslandRequiredPixelBrightnessToSupport;
private System.Windows.Forms.GroupBox groupBox3;
+2 -2
View File
@@ -106,7 +106,7 @@ namespace UVtools.GUI.Forms
nmIslandBinaryThreshold.Value = Settings.Default.IslandBinaryThreshold;
nmIslandRequiredAreaToProcessCheck.Value = Settings.Default.IslandRequiredAreaToProcessCheck;
nmIslandRequiredPixelBrightnessToProcessCheck.Value = Settings.Default.IslandRequiredPixelBrightnessToProcessCheck;
nmIslandRequiredPixelsToSupport.Value = Settings.Default.IslandRequiredPixelsToSupport;
nmIslandRequiredPixelsToSupportMultiplier.Value = Settings.Default.IslandRequiredPixelsToSupportMultiplier;
nmIslandRequiredPixelBrightnessToSupport.Value = Settings.Default.IslandRequiredPixelBrightnessToSupport;
cbOverhangIndependentFromIslands.Checked = Settings.Default.OverhangIndependentFromIslands;
@@ -301,7 +301,7 @@ namespace UVtools.GUI.Forms
Settings.Default.IslandBinaryThreshold = (byte)nmIslandBinaryThreshold.Value;
Settings.Default.IslandRequiredAreaToProcessCheck = (byte) nmIslandRequiredAreaToProcessCheck.Value;
Settings.Default.IslandRequiredPixelBrightnessToProcessCheck = (byte)nmIslandRequiredPixelBrightnessToProcessCheck.Value;
Settings.Default.IslandRequiredPixelsToSupport = (byte)nmIslandRequiredPixelsToSupport.Value;
Settings.Default.IslandRequiredPixelsToSupportMultiplier = nmIslandRequiredPixelsToSupportMultiplier.Value;
Settings.Default.IslandRequiredPixelBrightnessToSupport = (byte)nmIslandRequiredPixelBrightnessToSupport.Value;
Settings.Default.OverhangIndependentFromIslands = cbOverhangIndependentFromIslands.Checked;
-4
View File
@@ -126,10 +126,6 @@
<data name="cbIslandAllowDiagonalBonds.ToolTip" xml:space="preserve">
<value>If enabled, components touching by even a single diagonal bond will be considered a single component for the purposes of island detection.
Enabling this will result in faster island detection. but some potential islands with weak bonds to other components may not be detected.</value>
</data>
<data name="label9.ToolTip" xml:space="preserve">
<value>An island supported by at least this number of safe pixels will always be considered supported.
An island supported by less than this number of pixels will only be considered supported if the number of supporting pixels is at least half the area of the island itself.</value>
</data>
<data name="cbOverhangIndependentFromIslands.ToolTip" xml:space="preserve">
<value>If enabled, overhangs will be computed everywhere, including on islands. An overhang on an island will always be detected and reported. (Faster)