- **Layer:**
   - (Add) Property: `LayerMatBoundingRectangle`
   - (Add) Property: `LayerMatModelBoundingRectangle`
   - (Add) Method: `GetLayerMat(roi)`
- **Issues:**
   - **Islands:**
      - (Improvement) Islands detection performance
      - (Improvement) Required area to consider an island is now real area instead of bounding box area
      - (Fix) Logic bug when combining with overhangs
   - **Overhangs:**
      - (Improvement) Overhangs detection performance
      - (Improvement) Overhangs are now split and identified as separately in the layer
      - (Improvement) Overhangs now shows the correct issue area and able to locate the problem region more precisely
      - (Improvement) Compress overhangs into contours instead of using whole pixels, resulting in better render performance and less memory to hold the issue
      - (Fix) Bug in overhang logic causing to detect the problem twice when combined with supports
   - (Improvement) Touching bounds check logic to spare cycles
- **Tool - Raise platform on print finish:**
   - (Add) Preset "Minimum": Sets to the minimum position
   - (Add) Preset "Medium": Sets to half-way between minimum and maximum position
   - (Add) Preset "Maximum": Sets to the maximum position
   - (Add) Wait time: Sets the ensured wait time to stay still on the desired position.
           This is useful if the printer firmware always move to top and you want to stay still on the set position for at least the desired time.
           Note: The print time calculation will take this wait into consideration and display a longer print time.
- (Add) FileFormat: AnyCubic custom machine (.pwc)
- (Downgrade) OpenCV from 4.5.5 to 4.5.4 due a possible crash while detecting islands (Windows)
This commit is contained in:
Tiago Conceição
2022-10-02 00:44:39 +01:00
parent 46706f50a8
commit ca6f623a9f
37 changed files with 678 additions and 420 deletions
+4 -4
View File
@@ -14,6 +14,7 @@ using UVtools.Core.Scripting;
using Emgu.CV;
using Emgu.CV.CvEnum;
using UVtools.Core;
using UVtools.Core.Extensions;
namespace UVtools.ScriptSample;
@@ -86,9 +87,8 @@ public class ScriptInsetSample : ScriptGlobals
/// <returns>True if executes successfully to the end, otherwise false.</returns>
public bool ScriptExecute()
{
var anchor = new Point(-1, -1); // Kernel anchor, -1, -1 = center
var kernel =
CvInvoke.GetStructuringElement(ElementShape.Rectangle, new Size(3, 3), anchor); // Rectangle 3x3 kernel
CvInvoke.GetStructuringElement(ElementShape.Rectangle, new Size(3, 3), EmguExtensions.AnchorCenter); // Rectangle 3x3 kernel
Progress.Reset("Inset layers", Operation.LayerRangeCount); // Sets the progress name and number of items to process
@@ -104,10 +104,10 @@ public class ScriptInsetSample : ScriptGlobals
var target = Operation.GetRoiOrDefault(mat); // Get ROI from mat if user selected an region
// Erode original image by InsetMarginFromEdge pixels, so we get the offset margin from image and put new image on erodeMat
CvInvoke.Erode(target, erodeMat, kernel, anchor, InsetMarginFromEdge.Value, BorderType.Reflect101, default);
CvInvoke.Erode(target, erodeMat, kernel, EmguExtensions.AnchorCenter, InsetMarginFromEdge.Value, BorderType.Reflect101, default);
// Now erode the eroded image with InsetThickness pixels, so we get the original-margin-thickness image and put the new image on wallMat
CvInvoke.Erode(erodeMat, wallMat, kernel, anchor, InsetThickness.Value, BorderType.Reflect101, default);
CvInvoke.Erode(erodeMat, wallMat, kernel, EmguExtensions.AnchorCenter, InsetThickness.Value, BorderType.Reflect101, default);
// Subtract walls image from eroded image, so we get only the inset line pixels in white and put back into wallMat
CvInvoke.Subtract(erodeMat, wallMat, wallMat);