mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 19:42:32 +02:00
4600e81b08
- **(Add) Suggestions:**
- A new module that detect bad or parameters out of a defined range and suggest a change on the file, those can be auto applied if configured to do so
- **Avaliable suggestions:**
- **Bottom layer count:** Bottom layers should be kept to a minimum, usually from 2 to 3, it function is to provide a good adhesion to the first layer on the build plate, using a high count have disadvantages.
- **Wait time before cure:** Rest some time before cure the layer is crucial to let the resin settle after the lift sequence and allow some time for the arm settle at the correct Z position as the resin will offer some resistance and push the structure.
This lead to better quality with more successful prints, less lamination problems, better first layers with more success of stick to the build plate and less elephant foot effect.
- **Wait time after cure:** Rest some time after cure the layer and before the lift sequence can be important to allow the layer to cooldown a bit and detach better from the FEP.
- **Layer height:** Using the right layer height is important to get successful prints:
Thin layers may cause problems on adhesion, lamination, will print much slower and have no real visual benefits.
Thick layers may not fully cure no matter the exposure time you use, causing lamination and other hazards. Read your resin dtasheet to know the limits.
Using layer height with too many decimal digits may produce a wrong positioning due stepper step loss and/or Z axis quality.
- **Core:**
- Convert the project to Nullable aware and "null-safe"
- **File Formats:**
- (Add) `Volume` property to get the total model volume
- (Add) `SanitizeLayers` method to reassign indexes and force attribute parent file
- (Improvement) Merge `LayerManager` into `FileFormat` and cleanup: This affects the whole project and external scripts.
If using scripts please update them, search for `.LayerManager.` and replace by `.`
- (Change) Chitubox encrypted format can now be saved as normal
- (Fix) Converted files layers was pointing to the source file and related to it
- **Layers:**
- (Add) Methods: `ResetParameters`, `CopyParametersTo`, `CopyExposureTo`, `CopyWaitTimesTo`
- (Improvement) `IsBottomLayer` property will also return true when the index is inside bottom layer count
- **Scripting:**
- (Add) Configuration variable: `MinimumVersionToRun` - Sets the minimum version able to run the script
- (Improvement) Allow run scripts written in C# 10 with the new namespace; style as well as nullables methods
- (Improvement) Convert scripts to use Nullable code
- **UI:**
- (Add) Fluent Dark theme
- (Add) Default Light theme
- (Add) Default Dark theme
- (Change) Use fontawesome and material design to render the icons instead of static png images
- (Change) Some icons
- (Change) Move log tab to clipboard tab
- (Change) Tooltip overlay default color
- (Improvement) Windows position for tool windows, sometimes framework can return negative values affecting positions, now limits to 0 (#387)
- (Fix) Center image icon for layer action button
- (Fix) Center image icon for save layer image button
- **Tools:**
- (Add) Layer re-height: Offset mode, change layers position by a defined offset (#423)
- (Improvement) Rotate: Unable to use an angle of 0
- (Improvement) Remove layers: Will not recalcualte and reset properties of layers anymore, allowing removing layers on dynamic layer height models and others
- (Improvement) Clone layers: Will not recalcualte and reset properties of layers anymore, allowing cloning layers on dynamic layer height models and others
- (Fix) Exposure time finder: Very small printers may not print the stock object as it is configured, lead to a unknown error while generating the test. It will now show a better error message and advice a solution (#426)
- **Terminal:**
- (Add) More default namespaces
- (Improvement) Set a MinHeight for the rows to prevent spliter from eat the elements
- (Change) Set working space to the MainWindow instead of TerminalWindow
- **(Upgrade) .NET from 5.0.14 to 6.0.3**
- This brings big performance improvements, better JIT, faster I/O operations and others
- Read more: https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6
- Due this macOS requirement starts at 10.15 (Catalina)
- Read more: https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md
- (Add) Native support for MacOS ARM64 architecture (Mac M1 and upcomming Mac's) (#187)
- (Exchange) Dependency Newtonsoft Json by System.Text.Json to parse the json documents
- (Remove) "Automations - Light-off delay" in favor of new suggestion "wait time before cure" module
- (Fix) File - Send to: Winrar or 7zip have a wrong extension on the list (uvt) when should be (uvj)
- (Upgrade) AvaloniaUI from 0.10.12 to 0.10.13
262 lines
8.9 KiB
C#
262 lines
8.9 KiB
C#
/*
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE
|
|
* Version 3, 19 November 2007
|
|
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
* of this license document, but changing it is not allowed.
|
|
*/
|
|
|
|
using System.Collections.Generic;
|
|
|
|
namespace UVtools.Core.Layers;
|
|
|
|
#region LayerIssue Class
|
|
|
|
public sealed class IssuesDetectionConfiguration
|
|
{
|
|
public IslandDetectionConfiguration IslandConfig { get; }
|
|
public OverhangDetectionConfiguration OverhangConfig { get; }
|
|
public ResinTrapDetectionConfiguration ResinTrapConfig { get; }
|
|
public TouchingBoundDetectionConfiguration TouchingBoundConfig { get; }
|
|
public PrintHeightDetectionConfiguration PrintHeightConfig { get; }
|
|
public bool EmptyLayerConfig { get; }
|
|
|
|
public IssuesDetectionConfiguration(IslandDetectionConfiguration islandConfig,
|
|
OverhangDetectionConfiguration overhangConfig,
|
|
ResinTrapDetectionConfiguration resinTrapConfig,
|
|
TouchingBoundDetectionConfiguration touchingBoundConfig,
|
|
PrintHeightDetectionConfiguration printHeightConfig,
|
|
bool emptyLayerConfig)
|
|
{
|
|
IslandConfig = islandConfig;
|
|
OverhangConfig = overhangConfig;
|
|
ResinTrapConfig = resinTrapConfig;
|
|
TouchingBoundConfig = touchingBoundConfig;
|
|
PrintHeightConfig = printHeightConfig;
|
|
EmptyLayerConfig = emptyLayerConfig;
|
|
}
|
|
}
|
|
|
|
public sealed class IslandDetectionConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets if the detection is enabled
|
|
/// </summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a list of layers to check for islands, absent layers will not be checked.
|
|
/// Set to null to check every layer
|
|
/// </summary>
|
|
public List<uint>? WhiteListLayers { get; set; } = null;
|
|
|
|
/// <summary>
|
|
/// Combines the island and overhang detections for a better more realistic detection and to discard false-positives. (Slower)
|
|
/// If enabled, and when a island is found, it will check for overhangs on that same island, if no overhang found then the island will be discarded and considered safe, otherwise it will flag as an island issue.
|
|
/// Note: Overhangs settings will be used to configure the detection.Enabling Overhangs is not required for this procedure to work.
|
|
/// </summary>
|
|
public bool EnhancedDetection { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets the setting for whether or not diagonal bonds are considered when evaluation islands.
|
|
/// If true, all 8 neighbors of a pixel (including diagonals) will be considered when finding
|
|
/// individual components on the layer, if false only 4 neighbors (right, left, above, below)
|
|
/// will be considered..
|
|
/// </summary>
|
|
public bool AllowDiagonalBonds { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the binary threshold, all pixels below this value will turn in black, otherwise white
|
|
/// Set to 0 to disable this operation
|
|
/// </summary>
|
|
public byte BinaryThreshold { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Gets the required area size (x*y) to consider process a island (0-65535)
|
|
/// </summary>
|
|
public ushort RequiredAreaToProcessCheck { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Gets the required brightness for check a pixel under a island (0-255)
|
|
/// </summary>
|
|
public byte RequiredPixelBrightnessToProcessCheck { get; set; } = 10;
|
|
|
|
/// <summary>
|
|
/// Gets the required number of pixels to support a island and discard it as a issue (0-255)
|
|
/// </summary>
|
|
public byte RequiredPixelsToSupport { get; set; } = 10;
|
|
|
|
/// <summary>
|
|
/// Gets the required multiplier from the island pixels to support same island and discard it as a issue
|
|
/// </summary>
|
|
public decimal RequiredPixelsToSupportMultiplier { get; set; } = 0.25m;
|
|
|
|
/// <summary>
|
|
/// Gets the required brightness of supporting pixels to count as a valid support (0-255)
|
|
/// </summary>
|
|
public byte RequiredPixelBrightnessToSupport { get; set; } = 150;
|
|
|
|
public IslandDetectionConfiguration(bool enabled = true)
|
|
{
|
|
Enabled = enabled;
|
|
}
|
|
|
|
public IslandDetectionConfiguration Clone()
|
|
{
|
|
return (MemberwiseClone() as IslandDetectionConfiguration)!;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Overhang configuration
|
|
/// </summary>
|
|
public sealed class OverhangDetectionConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets if the detection is enabled
|
|
/// </summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a list of layers to check for overhangs, absent layers will not be checked.
|
|
/// Set to null to check every layer
|
|
/// </summary>
|
|
public List<uint>? WhiteListLayers { get; set; } = null;
|
|
|
|
/// <summary>
|
|
/// Gets or sets if should take in consideration the islands, if yes a island can't be a overhang at same time, otherwise islands and overhangs can be shared
|
|
/// </summary>
|
|
public bool IndependentFromIslands { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// After compute overhangs, masses with a number of pixels bellow this number will be discarded (Not a overhang)
|
|
/// </summary>
|
|
public byte RequiredPixelsToConsider { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Previous layer will be subtracted from current layer, after will erode by this value.
|
|
/// The survived pixels are potential overhangs.
|
|
/// </summary>
|
|
public byte ErodeIterations { get; set; } = 40;
|
|
|
|
public OverhangDetectionConfiguration(bool enabled = true)
|
|
{
|
|
Enabled = enabled;
|
|
}
|
|
}
|
|
|
|
public sealed class ResinTrapDetectionConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets if the detection is enabled
|
|
/// </summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the starting layer index for the detection which will also be considered a drain layer.
|
|
/// Use this setting to bypass complicated rafts by selected the model first real layer.
|
|
/// </summary>
|
|
public uint StartLayerIndex { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the binary threshold, all pixels below this value will turn in black, otherwise white
|
|
/// Set to 0 to disable this operation
|
|
/// </summary>
|
|
public byte BinaryThreshold { get; set; } = 127;
|
|
|
|
/// <summary>
|
|
/// Gets the required area size (x*y) to consider process a hollow area (0-255)
|
|
/// </summary>
|
|
public byte RequiredAreaToProcessCheck { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Gets the number of black pixels required to consider a drain
|
|
/// </summary>
|
|
public byte RequiredBlackPixelsToDrain { get; set; } = 10;
|
|
|
|
/// <summary>
|
|
/// Gets the maximum pixel brightness to be a drain pixel (0-150)
|
|
/// </summary>
|
|
public byte MaximumPixelBrightnessToDrain { get; set; } = 30;
|
|
|
|
/// <summary>
|
|
/// Gets if suction cups can also be detected together with resin traps
|
|
/// </summary>
|
|
public bool DetectSuctionCups { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Required minimum area to be considered a suction cup
|
|
/// </summary>
|
|
public uint RequiredAreaToConsiderSuctionCup { get; set; } = 100;
|
|
|
|
/// <summary>
|
|
/// Required minimum height (in mm) to be considered a suction cup
|
|
/// </summary>
|
|
public decimal RequiredHeightToConsiderSuctionCup { get; set; } = 0.5m;
|
|
|
|
|
|
public ResinTrapDetectionConfiguration(bool enabled = true)
|
|
{
|
|
Enabled = enabled;
|
|
}
|
|
}
|
|
|
|
|
|
public sealed class TouchingBoundDetectionConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Gets if the detection is enabled
|
|
/// </summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets the minimum pixel brightness to be a touching bound
|
|
/// </summary>
|
|
public byte MinimumPixelBrightness { get; set; } = 127;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the margin in pixels from left edge to check for touching white pixels
|
|
/// </summary>
|
|
public byte MarginLeft { get; set; } = 5;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the margin in pixels from top to check for touching white pixels
|
|
/// </summary>
|
|
public byte MarginTop { get; set; } = 5;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the margin in pixels from right edge to check for touching white pixels
|
|
/// </summary>
|
|
public byte MarginRight { get; set; } = 5;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the margin in pixels from bottom edge to check for touching white pixels
|
|
/// </summary>
|
|
public byte MarginBottom { get; set; } = 5;
|
|
|
|
|
|
public TouchingBoundDetectionConfiguration(bool enabled = true)
|
|
{
|
|
Enabled = enabled;
|
|
}
|
|
}
|
|
|
|
public sealed class PrintHeightDetectionConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Gets if the detection is enabled
|
|
/// </summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Get the offset from top to sum to printer max Z height
|
|
/// </summary>
|
|
public float Offset { get; set; }
|
|
|
|
public PrintHeightDetectionConfiguration(bool enabled = true)
|
|
{
|
|
Enabled = enabled;
|
|
}
|
|
}
|
|
|
|
#endregion |