sn4k3 / UVtools

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

[BUG] Issue with CTBv4 from Lychee with TSMC set off (possibly Lychee bug) #361

Closed hafriedlander closed 2 years ago

hafriedlander commented 2 years ago

System

Description

Lychee 3.6.0 when slicing CTBv4 has two options:

Two Stage Motion Control (TSMC) On/Off
Light On Delay (On) / Resting Delay (Off)

When TSMC is on, everything works fine.

When TSMC is off, there are two bugs

1) The Bottom Retract Speed summary displays as 0

This appears to be because Lychee is setting the PrintParametersV4->BottomRetractSpeed to 0 and setting the retract speed per layer (like the old CTBv3 behaviour)

Print Parameters V4 -> BottomRetractSpeed: 0, BottomRetractSpeed2: 0, Padding1: 0, Four1: 0, Padding2: 0, Four2: 0, RestTimeAfterRetract: 0, RestTimeAfterLift: 0, RestTimeBeforeLift: 0, BottomRetractHeight2: 0, Unknown1: 1684.6448, Unknown2: 9740, Unknown3: 0, LastLayerIndex: 303, Padding3: 0, Padding4: 0, Padding5: 0, Padding6: 0, DisclaimerAddress: 712, DisclaimerLength: 320, Reserved: System.Byte[]
-Image GROUP 0-

2) The RestTime values are always displayed as 0 (even when Resting Delay is set to On, and values provided)

This appears to be a bug in Lychee, the values output in debug during loading show 0

LAYER 18 -> LayerDef: PositionZ: 0.95, ExposureTime: 4.1, LightOffSeconds: 7.83, DataAddress: 216269, DataSize: 1427, Unknown1: 0, TableSize: 84, Unknown3: 0, Unknown4: 0, TotalSize: 1511, LiftHeight: 5, LiftSpeed: 40, LiftHeight2: 0, LiftSpeed2: 0, RetractSpeed: 40, RetractHeight2: 0, RetractSpeed2: 0, RestTimeBeforeLift: 0, RestTimeAfterLift: 0, RestTimeAfterRetract: 0, LightPWM: 100

To Reproduce

Export any file in Lychee 3.6.0 with CTBv4 and TSMC OFF

Expected behavior

BottomRetractSpeed and RestTime are displayed correctly

Sliced files

Correct (TSMC on)

tsmc_on.zip

Incorrect (TSMC off)

tsmc_off.zip

UVtools v2.25.3
Operative system: Microsoft Windows 10.0.19042 X64
Processor: Intel(R) Core(TM) i9-10980XE CPU @ 3.00GHz
Processor cores: 36
Memory RAM: 41.85 / 63.68 GB
Runtime: win10-x64
Framework: .NET 5.0.10
AvaloniaUI: 0.10.8
OpenCV: 4.5.4-235

Sreens, resolution, working area, usable area:
1: 1920 x 1080 @ 100% (Primary) (On this)
    WA: 1920 x 1040    UA: 1920 x 1040

Path: C:\Users\hafri\work\UVtools\UVtools.WPF\bin\Debug\net5.0

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

  Extra modules:
    Location (extra):            D:/bb/cv_x64/build/build_x64/../opencv_contrib/modules
    Version control (extra):     4.5.4-61-gc33e5b60

  Platform:
    Timestamp:                   2021-10-27T09:08:07Z
    Host:                        Windows 10.0.22000 AMD64
    CMake:                       3.21.3
    CMake generator:             Visual Studio 16 2019
    CMake build tool:            C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe
    MSVC:                        1929
    Configuration:               Debug Release MinSizeRel RelWithDebInfo

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe  (ver 19.29.30136.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP  /MD /O2 /Ob2 /DNDEBUG 
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP  /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /MP   /MD /O2 /Ob2 /DNDEBUG 
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /MP /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64  /INCREMENTAL:NO 
    Linker flags (Debug):        /machine:x64  /debug /INCREMENTAL 
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:          wsock32 comctl32 gdi32 ole32 setupapi ws2_32 D:/bb/cv_x64/build/build_x64/install/lib/freetype.lib D:/bb/cv_x64/build/build_x64/install/lib/harfbuzz.lib D:/bb/cv_x64/build/build_x64/install/lib/libhdf5.lib vtkRenderingOpenGL2 vtkCommonCore vtksys vtkCommonDataModel vtkCommonMath vtkCommonMisc vtkCommonSystem vtkCommonTransforms vtkCommonExecutionModel vtkRenderingCore vtkCommonColor vtkCommonComputationalGeometry vtkFiltersCore vtkFiltersGeneral vtkFiltersGeometry vtkFiltersSources vtkglew vtkInteractionStyle vtkFiltersExtraction vtkFiltersStatistics vtkImagingFourier vtkImagingCore vtkRenderingLOD vtkFiltersModeling vtkIOPLY vtkIOCore vtkdoubleconversion vtklz4 vtklzma vtkzlib vtkFiltersTexture vtkRenderingFreeType vtkfreetype vtkIOExport vtkIOImage vtkDICOMParser vtkmetaio vtkjpeg vtkpng vtktiff vtkIOXML vtkIOXMLParser vtkexpat vtkRenderingContext2D vtkRenderingGL2PSOpenGL2 vtkgl2ps vtkIOGeometry vtkIOLegacy
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp 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 freetype 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 ts video videoio videostab viz wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    python_bindings_generator python_tests world
    Disabled by dependency:      -
    Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv java julia matlab ovis python2 python3 sfm
    Applications:                perf_tests
    Documentation:               NO
    Non-free algorithms:         NO

  Windows RT support:            NO

  GUI:                           WIN32UI
    Win32 UI:                    YES
    VTK support:                 YES (ver 8.2.0)

  Media I/O: 
    ZLib:                        build (ver 1.2.11)
    JPEG:                        build-libjpeg-turbo (ver 2.1.0-62)
    WEBP:                        build (ver encoder: 0x020f)
    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:                      YES (prebuilt binaries)
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                YES (4.0.0)
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            Concurrency

  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 (NVD3D11)
    Include path:                D:/bb/cv_x64/build/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python (for build):            C:/python-virt/python37/python.exe

  Java:                          
    ant:                         NO
    JNI:                         C:/Program Files/Java/jdk1.8.0_202/include C:/Program Files/Java/jdk1.8.0_202/include/win32 C:/Program Files/Java/jdk1.8.0_202/include
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    D:/bb/cv_x64/build/build_x64/install
-----------------------------------------------------------------

Loaded Assemblies:
001: System.Private.CoreLib, Version=5.0.0.0
002: UVtools, Version=2.25.3.0
003: System.Runtime, Version=5.0.0.0
004: Avalonia.DesktopRuntime, Version=0.10.8.0
005: Avalonia.Controls, Version=0.10.8.0
006: netstandard, Version=2.1.0.0
007: Avalonia.Base, Version=0.10.8.0
008: System.ObjectModel, Version=5.0.0.0
009: Avalonia.Styling, Version=0.10.8.0
010: Avalonia.Input, Version=0.10.8.0
011: Avalonia.Interactivity, Version=0.10.8.0
012: Avalonia.Layout, Version=0.10.8.0
013: Avalonia.Visuals, Version=0.10.8.0
014: Avalonia.Animation, Version=0.10.8.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.25.3.0
019: System.Drawing.Primitives, Version=5.0.0.0
020: System.IO.FileSystem, Version=5.0.0.0
021: System.Numerics.Vectors, Version=5.0.0.0
022: MoreLinq, Version=3.3.2.0
023: System.Data.Common, Version=5.0.0.0
024: System.ComponentModel.TypeConverter, Version=5.0.0.0
025: System.ComponentModel, Version=5.0.0.0
026: System.Xml.ReaderWriter, Version=5.0.0.0
027: System.Private.Xml, Version=5.0.0.0
028: Avalonia.Desktop, Version=0.10.8.0
029: Avalonia.Win32, Version=0.10.8.0
030: Avalonia.MicroCom, Version=0.10.8.0
031: System.Runtime.InteropServices, Version=5.0.0.0
032: System.Collections.Concurrent, Version=5.0.0.0
033: Avalonia.X11, Version=0.10.8.0
034: Avalonia.Native, Version=0.10.8.0
035: Avalonia.Skia, Version=0.10.8.0
036: System.Runtime.InteropServices.RuntimeInformation, Version=5.0.0.0
037: Avalonia.OpenGL, Version=0.10.8.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: Microsoft.Win32.Primitives, Version=5.0.0.0
050: SkiaSharp, Version=2.80.0.0
051: Avalonia.Markup.Xaml, Version=0.10.8.0
052: Avalonia.Themes.Fluent, Version=0.10.8.0
053: Avalonia.Markup, Version=0.10.8.0
054: System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0
055: ThemeEditor.Controls.ColorPicker, Version=0.10.8.0
056: Avalonia.Controls.DataGrid, Version=0.10.8.0
057: Emgu.CV.Platform.NetStandard, Version=4.5.4.4788
058: MessageBox.Avalonia, Version=1.0.0.0
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: Avalonia.Diagnostics, Version=0.10.8.0
071: UVtools.AvaloniaControls, Version=1.0.1.0
072: System.Drawing.Common, Version=4.0.0.0
073: System.Linq.Expressions, Version=5.0.0.0
074: System.ComponentModel.Annotations, Version=5.0.0.0
075: System.Reflection.Emit.Lightweight, Version=5.0.0.0
076: Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0
077: System.Buffers, Version=5.0.0.0
078: HarfBuzzSharp, Version=1.0.0.0
079: System.IO.Compression, Version=5.0.0.0
080: Newtonsoft.Json, Version=13.0.0.0
081: System.Diagnostics.Tracing, Version=5.0.0.0
082: System.Diagnostics.DiagnosticSource, Version=5.0.0.0
083: System.Net.Security, Version=5.0.0.0
084: System.Security.Cryptography.X509Certificates, Version=5.0.0.0
085: BinarySerializer, Version=8.6.1.2
086: System.Threading.Tasks, Version=5.0.0.0
087: System.Text.Encoding, Version=5.0.0.0
088: System.IO, Version=5.0.0.0
089: System.Reflection.TypeExtensions, Version=5.0.0.0
090: System.Reflection, Version=5.0.0.0
091: System.Reflection.Extensions, Version=5.0.0.0
092: System.Net.Sockets, Version=5.0.0.0
093: System.Net.NameResolution, Version=5.0.0.0
094: System.IO.Compression.ZipFile, Version=5.0.0.0
095: System.Collections.Specialized, Version=5.0.0.0
096: System.Security.Cryptography.Primitives, Version=5.0.0.0
097: System.Security.Principal.Windows, Version=6.0.0.0
098: System.Security.Claims, Version=5.0.0.0
099: System.Security.Principal, Version=5.0.0.0
100: System.Threading.Tasks.Parallel, Version=5.0.0.0
101: System.Security.Cryptography.Encoding, Version=5.0.0.0
102: System.Runtime.Numerics, Version=5.0.0.0
103: System.IO.FileSystem.DriveInfo, Version=5.0.0.0
104: Microsoft.Win32.Registry, Version=6.0.0.0
sn4k3 commented 2 years ago

Yes, not UVtools related. All that fields are coming from Lychee and untouched by UVtools. Please forward the problem to Lychee team.

Still even if 0 on global table, the speed on per layer will be followed, so not a real problem. The retract speed is present on other main table (Print Parameters) the V4 table is related to new TSMC and may not require to be filled.

010Editor_2021-12-04_04-17-31

The only problem i see is with rest times being 0...

hafriedlander commented 2 years ago

I've flagged with Lychee, but didn't see a response from them. No reason to leave this open though. Closing for now.