sn4k3 / UVtools

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

[BUG] Incorrect calculation material cost after fix issues #449

Closed antwal closed 2 years ago

antwal commented 2 years ago

System

UVtools v3.2.1
Operative system: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Feb 15 21:39:11 PST 2022; root:xnu-6153.141.59~1/RELEASE_X86_64 X64
Processor: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Processor cores: 16
Memory RAM: 34.24 / 64.12 GB
Runtime: osx.10.15-x64
Framework: .NET 6.0.3
AvaloniaUI: 0.10.13
OpenCV: 4.5.4-235

Sreens, resolution, working area, usable area:
1: 2560 x 1440 @ 200% (Primary)
    WA: 2560 x 1417    UA: 1280 x 708
2: 2560 x 1440 @ 200%
    WA: 2560 x 1417    UA: 1280 x 708
3: 2560 x 1440 @ 200%
    WA: 2560 x 1417    UA: 1280 x 708

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

Describe the bug

Open SL1 file, click on issues, click on repair issues, the material used is update but the price no

sn4k3 commented 2 years ago

MaterialMl is calculated independently and do not require external user variables, but not the price. The price information comes from SL1 file information and is one of the few formats who output resin price information. This information not even show on most of other formats. The only way to calculate price is to know used resin price, which UVtools can not know. While SL1 have such information others don't and can't be abstracted.

However i can do math calculation to update price on the few supported files, if that's important

antwal commented 2 years ago

I understand, I purposely use prusaslicer because it is one of the few that calculates the price; on some files corrected with uvtools initially they were 98ml after the fix of the problems they had become 170ml, but the price was not recalculated.

I could do the calculation manually but since the price has been implemented it would be convenient to have it recalculated.

sn4k3 commented 2 years ago

Implemented

antwal commented 2 years ago

the problem has come back, I will have to create an app that analyzes the file in order to have the precise calculation of the costs; the material, as always, is calculated correctly

sn4k3 commented 2 years ago

The calculation have not changed since v3.2.2. I can't observe the problem, please attach a file that does and the workflow. Also provide more information, price before layer fix and after fix, what auto fixes do you run and any other task you done.

antwal commented 2 years ago

The calculation have not changed since v3.2.2. I can't observe the problem, please attach a file that does and the workflow. Also provide more information, price before layer fix and after fix, what auto fixes do you run and any other task you done.

I am currently using version 3.3.2 which works best even though it has several bugs and is not calculated correctly

Updated: I tested an object on version 3.5.5 that went from 90ml to 130ml after the fixes and I saw that the price updates correctly