sn4k3 / UVtools

MSLA/DLP, file analysis, calibration, repair, conversion and manipulation
GNU Affero General Public License v3.0
1.24k stars 106 forks source link

[BUG] Exposure test error on Photon Ultra #426

Closed bljfour closed 2 years ago

bljfour commented 2 years ago

System

1. Go to "UVtools -> Help -> About"
2. Right click on "Copy information" -> "Copy the essential information"
3. Paste that infomation bellow this line:
UVtools v2.29.0
Operative system: Darwin 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 X64
Processor: Apple M1 Pro
Processor cores: 10
Memory RAM: 15.89 / 30.52 GB
Runtime: osx.11.1-x64
Framework: .NET 5.0.14
AvaloniaUI: 0.10.12
OpenCV: 4.5.4-235

Sreens, resolution, working area, usable area:
1: 3008 x 1692 @ 200% (Primary)
    WA: 3008 x 1582    UA: 1504 x 791
2: 3008 x 1692 @ 200%
    WA: 3008 x 1667    UA: 1504 x 834

Path: /Applications/UVtools.app/Contents/MacOS

General configuration for OpenCV 4.5.4 =====================================
  Version control:               4.5.4-235-g27567928d7

  Extra modules:
    Location (extra):            /Users/tiago/Desktop/emgucv/opencv_contrib/modules
    Version control (extra):     4.5.4-61-gc33e5b60

  Platform:
    Timestamp:                   2021-11-01T19:19:02Z
    Host:                        Darwin 18.7.0 x86_64
    CMake:                       3.21.4
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3 SSSE3 SSE4_1
      requested:                 DETECT
    Dispatched code generation:  SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_2 (1 files):          + POPCNT SSE4_2
      FP16 (0 files):            + POPCNT SSE4_2 FP16 AVX
      AVX (4 files):             + POPCNT SSE4_2 AVX
      AVX2 (30 files):           + POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (5 files):      + POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /Library/Developer/CommandLineTools/usr/bin/c++  (ver 10.0.1.10010046)
    C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /Library/Developer/CommandLineTools/usr/bin/cc
    C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,-dead_strip  
    Linker flags (Debug):        -Wl,-dead_strip  
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:          -framework OpenCL -framework Cocoa -framework AppKit /Users/tiago/Desktop/emgucv/platforms/macos/build/install/lib/libhdf5.a Iconv::Iconv
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libpng libtiff libopenjp2 IlmImf zlib quirc

  OpenCV modules:
    To be built:                 alphamat aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    python2 world
    Disabled by dependency:      -
    Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype java julia matlab ovis python3 sfm ts viz
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           COCOA
    Cocoa:                       YES
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.11)
    JPEG:                        build-libjpeg-turbo (ver 2.1.0-62)
    PNG:                         build (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      NO
      avcodec:                   NO
      avformat:                  NO
      avutil:                    NO
      swscale:                   NO
      avresample:                NO
    GStreamer:                   NO
    AVFoundation:                YES

  Parallel framework:            GCD

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Eigen:                       YES (ver 3.3.7)
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  OpenCL:                        YES (no extra features)
    Include path:                NO
    Link libraries:              -framework OpenCL

  Python (for build):            /usr/bin/python2.7

  Java:                          
    ant:                         NO
    JNI:                         /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/JavaVM.framework/Headers /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/JavaVM.framework/Headers /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/JavaVM.framework/Headers
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /Users/tiago/Desktop/emgucv/platforms/macos/build/install
-----------------------------------------------------------------

Loaded Assemblies:
001: System.Private.CoreLib, Version=5.0.0.0
002: UVtools, Version=2.29.0.0
003: System.Runtime, Version=5.0.0.0
004: Avalonia.DesktopRuntime, Version=0.10.12.0
005: Avalonia.Controls, Version=0.10.12.0
006: netstandard, Version=2.1.0.0
007: Avalonia.Base, Version=0.10.12.0
008: System.ObjectModel, Version=5.0.0.0
009: Avalonia.Styling, Version=0.10.12.0
010: Avalonia.Input, Version=0.10.12.0
011: Avalonia.Interactivity, Version=0.10.12.0
012: Avalonia.Layout, Version=0.10.12.0
013: Avalonia.Visuals, Version=0.10.12.0
014: Avalonia.Animation, Version=0.10.12.0
015: System.ComponentModel.Primitives, Version=5.0.0.0
016: System.Collections, Version=5.0.0.0
017: System.Console, Version=5.0.0.0
018: UVtools.Core, Version=2.29.0.0
019: System.Drawing.Primitives, Version=5.0.0.0
020: System.IO.FileSystem, Version=5.0.0.0
021: MoreLinq, Version=3.3.2.0
022: System.Data.Common, Version=5.0.0.0
023: System.ComponentModel.TypeConverter, Version=5.0.0.0
024: System.ComponentModel, Version=5.0.0.0
025: System.Xml.ReaderWriter, Version=5.0.0.0
026: System.Private.Xml, Version=5.0.0.0
027: Avalonia.Desktop, Version=0.10.12.0
028: Avalonia.Win32, Version=0.10.12.0
029: Avalonia.MicroCom, Version=0.10.12.0
030: System.Runtime.InteropServices, Version=5.0.0.0
031: System.Collections.Concurrent, Version=5.0.0.0
032: System.Numerics.Vectors, Version=5.0.0.0
033: Avalonia.X11, Version=0.10.12.0
034: Avalonia.Native, Version=0.10.12.0
035: Avalonia.Skia, Version=0.10.12.0
036: System.Runtime.InteropServices.RuntimeInformation, Version=5.0.0.0
037: Avalonia.OpenGL, Version=0.10.12.0
038: System.Reactive, Version=5.0.0.0
039: System.Threading, Version=5.0.0.0
040: System.Private.Uri, Version=5.0.0.0
041: System.Linq, Version=5.0.0.0
042: System.Runtime.Extensions, Version=5.0.0.0
043: System.Xml.XDocument, Version=5.0.0.0
044: System.Private.Xml.Linq, Version=5.0.0.0
045: System.Threading.Thread, Version=5.0.0.0
046: System.Memory, Version=5.0.0.0
047: System.Security.Cryptography.Algorithms, Version=5.0.0.0
048: System.Text.Encoding.Extensions, Version=5.0.0.0
049: SkiaSharp, Version=2.88.0.0
050: System.Threading.Timer, Version=5.0.0.0
051: Avalonia.Markup.Xaml, Version=0.10.12.0
052: Avalonia.Themes.Fluent, Version=0.10.12.0
053: System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0
054: Avalonia.Markup, Version=0.10.12.0
055: ThemeEditor.Controls.ColorPicker, Version=0.10.12.0
056: Avalonia.Controls.DataGrid, Version=0.10.12.0
057: MessageBox.Avalonia, Version=1.0.0.0
058: Emgu.CV.Platform.NetStandard, Version=4.5.5.4823
059: System.Xml.XmlSerializer, Version=5.0.0.0
060: System.Collections.NonGeneric, Version=5.0.0.0
061: System.Diagnostics.TraceSource, Version=5.0.0.0
062: System.Text.RegularExpressions, Version=5.0.0.0
063: System.Net.Http, Version=5.0.0.0
064: System.Net.Primitives, Version=5.0.0.0
065: System.Reflection.Emit.ILGeneration, Version=5.0.0.0
066: System.Reflection.Emit, Version=5.0.0.0
067: Microsoft.GeneratedCode, Version=1.0.0.0
068: System.Reflection.Primitives, Version=5.0.0.0
069: Microsoft.GeneratedCode, Version=1.0.0.0
070: System.Buffers, Version=5.0.0.0
071: UVtools.AvaloniaControls, Version=1.0.1.0
072: System.Linq.Expressions, Version=5.0.0.0
073: System.ComponentModel.Annotations, Version=5.0.0.0
074: System.Reflection.Emit.Lightweight, Version=5.0.0.0
075: Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0
076: System.Diagnostics.Process, Version=5.0.0.0
077: HarfBuzzSharp, Version=1.0.0.0
078: System.IO.Compression, Version=5.0.0.0
079: Newtonsoft.Json, Version=13.0.0.0
080: System.Diagnostics.Tracing, Version=5.0.0.0
081: System.Diagnostics.DiagnosticSource, Version=5.0.0.0
082: System.Net.Security, Version=5.0.0.0
083: System.Security.Cryptography.X509Certificates, Version=5.0.0.0
084: BinarySerializer, Version=8.6.2.2
085: System.Threading.Tasks, Version=5.0.0.0
086: System.Text.Encoding, Version=5.0.0.0
087: System.IO, Version=5.0.0.0
088: System.Reflection.TypeExtensions, Version=5.0.0.0
089: System.Reflection, Version=5.0.0.0
090: System.Reflection.Extensions, Version=5.0.0.0
091: System.Net.Sockets, Version=5.0.0.0
092: Microsoft.Win32.Primitives, Version=5.0.0.0
093: System.Threading.ThreadPool, Version=5.0.0.0
094: System.Net.NameResolution, Version=5.0.0.0
095: System.IO.Compression.ZipFile, Version=5.0.0.0
096: System.Collections.Specialized, Version=5.0.0.0
097: System.Threading.Tasks.Parallel, Version=5.0.0.0
098: System.Security.Cryptography.Encoding, Version=5.0.0.0
099: System.Formats.Asn1, Version=5.0.0.0
100: System.Runtime.Numerics, Version=5.0.0.0
101: System.Security.Cryptography.Primitives, Version=5.0.0.0
102: System.IO.FileSystem.DriveInfo, Version=5.0.0.0
103: System.Diagnostics.StackTrace, Version=5.0.0.0
104: System.Reflection.Metadata, Version=5.0.0.0
105: System.Collections.Immutable, Version=5.0.0.0
106: System.IO.MemoryMappedFiles, Version=5.0.0.0
107: Microsoft.Win32.Registry, Version=6.0.0.0

Describe the bug

An exception is thrown when trying to generate an exposure test for the Anycubic Photon Ultra.

To Reproduce

Steps to reproduce the behavior:

  1. Load test print included with Anycubic Photon Ultra ("TEST.dlp")
  2. Select Calibration->Exposure Time Finder
  3. Don't change any settings
  4. Press "Exposure time finder" button on the bottom of the window

Expected behavior

Expected to have a file generated, instead I get this exception:

System.IndexOutOfRangeException: Index was outside the bounds of the array. at UVtools.Core.LayerManager.GetBoundingRectangle(OperationProgress progress) at UVtools.Core.LayerManager.get_BoundingRectangle() in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\Layers\LayerManager.cs:line 178 at UVtools.Core.FileFormats.FileFormat.get_BoundingRectangle() in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\FileFormats\FileFormat.cs:line 1112 at UVtools.Core.Operations.Operation..ctor(FileFormat slicerFile) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\Operations\Operation.cs:line 300 at UVtools.Core.Operations.OperationCalibrateExposureFinder.ExecuteInternally(OperationProgress progress) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\Operations\OperationCalibrateExposureFinder.cs:line 2250 at UVtools.Core.Operations.Operation.Execute(OperationProgress progress) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\Operations\Operation.cs:line 549 at UVtools.WPF.MainWindow.<>c__DisplayClass116_0.b__0() in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.WPF\MainWindow.axaml.cs:line 2364

sn4k3 commented 2 years ago

That's strange. Can you attach the test file here?

bljfour commented 2 years ago

TEST.zip

sn4k3 commented 2 years ago

I'm getting diferent error. Which settings you used inside the tool? BTW: Anycubic machines are not compatible with multiple exposures

bljfour commented 2 years ago

I didn’t change any settings in the tool—just loaded the test file, opened up the exposure finder and clicked the button to generate. I was just trying to create a default exposure test before changing settings to generate others.

Besides the Photon Ultra, I have a Photon Mono X and so I was just following my previous workflow of creating 5 or so different exposure tests to print and see which settings work best with the resin I have.

On Wed, Mar 9, 2022 at 9:02 PM Tiago Conceição @.***> wrote:

I'm getting diferent error. Which settings you used inside the tool? BTW: Anycubic machines are not compatible with multiple exposures

— Reply to this email directly, view it on GitHub https://github.com/sn4k3/UVtools/issues/426#issuecomment-1063667327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3MEE5XPUTNXR6ABRDOD5LU7F645ANCNFSM5QLLJEOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

sn4k3 commented 2 years ago

I found the problem... The stock test is taller than your printer resolution, and when it try to fit or move it triggers the error. If you remove the Bulleye to make it short it will work fine. That printer is really small :( You will have to adjust properties to optimize the size of it

UVtools_2022-03-10_20-39-45

bljfour commented 2 years ago

Thanks for finding the problem and responding so quickly! And yes, the print area is tiny!

bljfour commented 2 years ago

And I also see no errors now when I remove the bullseye

sn4k3 commented 2 years ago

If you set Top/bottom margin to 0mm you will be able to fit the whole test UVtools_2022-03-10_20-46-42

sn4k3 commented 2 years ago

I have this check but i forget to add the margin to it, will fix on next patch

if (layers[0].Width > SlicerFile.ResolutionX || layers[0].Height > SlicerFile.ResolutionY)
{
    return false;
}

New patch will produce a better error message:

UVtools_2022-03-10_20-57-29

if (layers[0].Width+sideMarginPx > SlicerFile.ResolutionX || layers[0].Height+topBottomMarginPx > SlicerFile.ResolutionY)
{
    throw new InvalidOperationException("The used configuration can not produce a test due insufficient space.\n" +
                                        "Try to adjust sides and/or top/bottom margins to gain space or object features to shorten the test size.");
    //return false;
}