Skip to content

Implement support for CTBv4 and encrypted CTB files #10531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NickSica
Copy link

@NickSica NickSica commented May 11, 2023

This implements support for CTBv4 and adds GUI elements for all the new configuration options included.

Some issues right now are the thumbnail color not matching what comes out in the sl1s file and the layers being slightly off when it comes to size of the object in the layer(X and Y may be off by the same amount but their ratio is correct) the size being off actually matches what comes out of another slicer so this may just be an issue that comes with the file. This should close #5280 unless there's a specific need for the older CTB version. It shouldn't be hard to implement based off of this, though.

@NickSica NickSica changed the title Implement support for CTB Implement support for CTB files May 11, 2023
@h-2
Copy link
Contributor

h-2 commented Jun 22, 2023

Looking forward to this :)

@CaidenKehrer
Copy link

I really hope this gets added soon! I would love to use prusia slicer instead of chitubox.

@NickSica
Copy link
Author

NickSica commented Jul 6, 2023

I really hope this gets added soon! I would love to use prusia slicer instead of chitubox.

Me too, I am really just waiting for someone to take a look at it. The past few changes have been bringing main branch changes over to this branch.

@wbehrens-on-gh
Copy link

@NickSica I love you, just bought a mars 3 as my first resin printer without knowing about all this anti-competitive/drm bs from chitubox. you are a life saver.

@NickSica
Copy link
Author

@NickSica I love you, just bought a mars 3 as my first resin printer without knowing about all this anti-competitive/drm bs from chitubox. you are a life saver.

Yeah I'm with you there I'm working slowly to allow people to get away from all the proprietary lock-in and outrageous slicer costs that resin printers have. At least it looks like Elegoo is moving slowly towards open source.

@wbehrens-on-gh
Copy link

I've attempted to build your patch but I'm getting the following error when tests are run

prusa-slicer-git> Running tests...
prusa-slicer-git> /nix/store/p6nyqsw5qbg114gprcj4ci8j4nx9nhnb-cmake-3.26.4/bin/ctest --force-new-ctest-process
prusa-slicer-git> Test project /build/source/build
prusa-slicer-git>     Start 1: libnest2d_tests
prusa-slicer-git>     Start 2: libslic3r_tests
prusa-slicer-git>     Start 3: slic3rutils_tests
prusa-slicer-git>     Start 4: fff_print_tests
prusa-slicer-git>     Start 5: sla_print_tests
prusa-slicer-git> 1/5 Test #3: slic3rutils_tests ................   Passed    0.09 sec
prusa-slicer-git> 2/5 Test #1: libnest2d_tests ..................   Passed    0.19 sec
prusa-slicer-git> 3/5 Test #2: libslic3r_tests ..................   Passed    4.33 sec
prusa-slicer-git> 4/5 Test #4: fff_print_tests ..................   Passed    6.78 sec
prusa-slicer-git> 5/5 Test #5: sla_print_tests ..................***Exception: SegFault 22.40 sec
prusa-slicer-git> [2023-08-12 18:40:15.344682] [0x00007ffff4064b80] [trace]   Initializing StaticPrintConfigs
prusa-slicer-git> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prusa-slicer-git> sla_print_tests is a Catch v2.13.6 host application.
prusa-slicer-git> Run with -? for options
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> Archive export test
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14
prusa-slicer-git> ...............................................................................
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14: FAILED:
prusa-slicer-git>   {Unknown expression after the reported line}
prusa-slicer-git> due to a fatal error condition:
prusa-slicer-git>   Testing archive type: ctb -- writing...
prusa-slicer-git>   SIGSEGV - Segmentation violation signal
prusa-slicer-git> ===============================================================================
prusa-slicer-git> test cases:    29 |    28 passed | 1 failed
prusa-slicer-git> assertions: 12821 | 12820 passed | 1 failed
prusa-slicer-git> 80% tests passed, 1 tests failed out of 5
prusa-slicer-git> Total Test time (real) =  22.40 sec
prusa-slicer-git> The following tests FAILED:
prusa-slicer-git>         5 - sla_print_tests (SEGFAULT)
prusa-slicer-git> Errors while running CTest
prusa-slicer-git> make: *** [Makefile:71: test] Error 8

@NickSica
Copy link
Author

NickSica commented Aug 12, 2023

I've attempted to build your patch but I'm getting the following error when tests are run

prusa-slicer-git> Running tests...
prusa-slicer-git> /nix/store/p6nyqsw5qbg114gprcj4ci8j4nx9nhnb-cmake-3.26.4/bin/ctest --force-new-ctest-process
prusa-slicer-git> Test project /build/source/build
prusa-slicer-git>     Start 1: libnest2d_tests
prusa-slicer-git>     Start 2: libslic3r_tests
prusa-slicer-git>     Start 3: slic3rutils_tests
prusa-slicer-git>     Start 4: fff_print_tests
prusa-slicer-git>     Start 5: sla_print_tests
prusa-slicer-git> 1/5 Test #3: slic3rutils_tests ................   Passed    0.09 sec
prusa-slicer-git> 2/5 Test #1: libnest2d_tests ..................   Passed    0.19 sec
prusa-slicer-git> 3/5 Test #2: libslic3r_tests ..................   Passed    4.33 sec
prusa-slicer-git> 4/5 Test #4: fff_print_tests ..................   Passed    6.78 sec
prusa-slicer-git> 5/5 Test #5: sla_print_tests ..................***Exception: SegFault 22.40 sec
prusa-slicer-git> [2023-08-12 18:40:15.344682] [0x00007ffff4064b80] [trace]   Initializing StaticPrintConfigs
prusa-slicer-git> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prusa-slicer-git> sla_print_tests is a Catch v2.13.6 host application.
prusa-slicer-git> Run with -? for options
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> Archive export test
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14
prusa-slicer-git> ...............................................................................
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14: FAILED:
prusa-slicer-git>   {Unknown expression after the reported line}
prusa-slicer-git> due to a fatal error condition:
prusa-slicer-git>   Testing archive type: ctb -- writing...
prusa-slicer-git>   SIGSEGV - Segmentation violation signal
prusa-slicer-git> ===============================================================================
prusa-slicer-git> test cases:    29 |    28 passed | 1 failed
prusa-slicer-git> assertions: 12821 | 12820 passed | 1 failed
prusa-slicer-git> 80% tests passed, 1 tests failed out of 5
prusa-slicer-git> Total Test time (real) =  22.40 sec
prusa-slicer-git> The following tests FAILED:
prusa-slicer-git>         5 - sla_print_tests (SEGFAULT)
prusa-slicer-git> Errors while running CTest
prusa-slicer-git> make: *** [Makefile:71: test] Error 8

That is odd. I'll take a look when I'm back home. If there are any other detailed logs it'd help me look into it.

@NickSica
Copy link
Author

I've attempted to build your patch but I'm getting the following error when tests are run

prusa-slicer-git> Running tests...
prusa-slicer-git> /nix/store/p6nyqsw5qbg114gprcj4ci8j4nx9nhnb-cmake-3.26.4/bin/ctest --force-new-ctest-process
prusa-slicer-git> Test project /build/source/build
prusa-slicer-git>     Start 1: libnest2d_tests
prusa-slicer-git>     Start 2: libslic3r_tests
prusa-slicer-git>     Start 3: slic3rutils_tests
prusa-slicer-git>     Start 4: fff_print_tests
prusa-slicer-git>     Start 5: sla_print_tests
prusa-slicer-git> 1/5 Test #3: slic3rutils_tests ................   Passed    0.09 sec
prusa-slicer-git> 2/5 Test #1: libnest2d_tests ..................   Passed    0.19 sec
prusa-slicer-git> 3/5 Test #2: libslic3r_tests ..................   Passed    4.33 sec
prusa-slicer-git> 4/5 Test #4: fff_print_tests ..................   Passed    6.78 sec
prusa-slicer-git> 5/5 Test #5: sla_print_tests ..................***Exception: SegFault 22.40 sec
prusa-slicer-git> [2023-08-12 18:40:15.344682] [0x00007ffff4064b80] [trace]   Initializing StaticPrintConfigs
prusa-slicer-git> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prusa-slicer-git> sla_print_tests is a Catch v2.13.6 host application.
prusa-slicer-git> Run with -? for options
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> Archive export test
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14
prusa-slicer-git> ...............................................................................
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14: FAILED:
prusa-slicer-git>   {Unknown expression after the reported line}
prusa-slicer-git> due to a fatal error condition:
prusa-slicer-git>   Testing archive type: ctb -- writing...
prusa-slicer-git>   SIGSEGV - Segmentation violation signal
prusa-slicer-git> ===============================================================================
prusa-slicer-git> test cases:    29 |    28 passed | 1 failed
prusa-slicer-git> assertions: 12821 | 12820 passed | 1 failed
prusa-slicer-git> 80% tests passed, 1 tests failed out of 5
prusa-slicer-git> Total Test time (real) =  22.40 sec
prusa-slicer-git> The following tests FAILED:
prusa-slicer-git>         5 - sla_print_tests (SEGFAULT)
prusa-slicer-git> Errors while running CTest
prusa-slicer-git> make: *** [Makefile:71: test] Error 8

I rebuilt it from scratch and didn't get these errors so if it's an actual issue.

@h-2
Copy link
Contributor

h-2 commented Aug 16, 2023

Mabye CI would help for cases like this? Just saying 😇

@NickSica
Copy link
Author

Mabye CI would help for cases like this? Just saying 😇

Sorry for the ignorance I'm relatively new to GitHub workflows past the basica. Isn't that something that Prusa would have to add to their repo?

@h-2
Copy link
Contributor

h-2 commented Aug 16, 2023

Mabye CI would help for cases like this? Just saying 😇

Sorry for the ignorance I'm relatively new to GitHub workflows past the basica. Isn't that something that Prusa would have to add to their repo?

Yes, absolutely! That's what I meant. It's difficult for contributors to argue about whether something works on one computer or the other. If the repository had CI, that would be the criteria for "working" or "not working".

@wbehrens-on-gh
Copy link

I've attempted to build your patch but I'm getting the following error when tests are run

prusa-slicer-git> Running tests...
prusa-slicer-git> /nix/store/p6nyqsw5qbg114gprcj4ci8j4nx9nhnb-cmake-3.26.4/bin/ctest --force-new-ctest-process
prusa-slicer-git> Test project /build/source/build
prusa-slicer-git>     Start 1: libnest2d_tests
prusa-slicer-git>     Start 2: libslic3r_tests
prusa-slicer-git>     Start 3: slic3rutils_tests
prusa-slicer-git>     Start 4: fff_print_tests
prusa-slicer-git>     Start 5: sla_print_tests
prusa-slicer-git> 1/5 Test #3: slic3rutils_tests ................   Passed    0.09 sec
prusa-slicer-git> 2/5 Test #1: libnest2d_tests ..................   Passed    0.19 sec
prusa-slicer-git> 3/5 Test #2: libslic3r_tests ..................   Passed    4.33 sec
prusa-slicer-git> 4/5 Test #4: fff_print_tests ..................   Passed    6.78 sec
prusa-slicer-git> 5/5 Test #5: sla_print_tests ..................***Exception: SegFault 22.40 sec
prusa-slicer-git> [2023-08-12 18:40:15.344682] [0x00007ffff4064b80] [trace]   Initializing StaticPrintConfigs
prusa-slicer-git> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prusa-slicer-git> sla_print_tests is a Catch v2.13.6 host application.
prusa-slicer-git> Run with -? for options
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> Archive export test
prusa-slicer-git> -------------------------------------------------------------------------------
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14
prusa-slicer-git> ...............................................................................
prusa-slicer-git> /build/source/tests/sla_print/sla_archive_readwrite_tests.cpp:14: FAILED:
prusa-slicer-git>   {Unknown expression after the reported line}
prusa-slicer-git> due to a fatal error condition:
prusa-slicer-git>   Testing archive type: ctb -- writing...
prusa-slicer-git>   SIGSEGV - Segmentation violation signal
prusa-slicer-git> ===============================================================================
prusa-slicer-git> test cases:    29 |    28 passed | 1 failed
prusa-slicer-git> assertions: 12821 | 12820 passed | 1 failed
prusa-slicer-git> 80% tests passed, 1 tests failed out of 5
prusa-slicer-git> Total Test time (real) =  22.40 sec
prusa-slicer-git> The following tests FAILED:
prusa-slicer-git>         5 - sla_print_tests (SEGFAULT)
prusa-slicer-git> Errors while running CTest
prusa-slicer-git> make: *** [Makefile:71: test] Error 8

I rebuilt it from scratch and didn't get these errors so if it's an actual issue.

I'm trying to build prusa slicer using an overlay in nix

  prusa-slicer_overlay = (self: super: {
    prusa-slicer = super.prusa-slicer.overrideAttrs (prev: {
      version = "git";
      patches = [];
      src = pkgs.fetchFromGitHub {
        owner = "NickSica";
        repo = "PrusaSlicer";
        hash = "sha256-FnYT7ZHPl8SrJyitidg+RtIT9foGWHfcCgth3urac5k=";
        rev = "master";
      };
    });
  });

I had hoped it wasn't an issue with the package but it sounds like it

@NickSica
Copy link
Author

Does it automatically run cmake and such following the build instructions in the repo?

@wbehrens-on-gh
Copy link

here is the package https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/applications/misc/prusa-slicer/default.nix the overlay should just swap out the sources. Is there a cmake flag missing? From what I could tell in the diff it doesn't seem like it.

@NickSica
Copy link
Author

here is the package https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/applications/misc/prusa-slicer/default.nix the overlay should just swap out the sources. Is there a cmake flag missing? From what I could tell in the diff it doesn't seem like it.

Yeah I'm not quite sure I was able to build using the flags that package has just fine on Arch. I've also never used nix so I'm unsure what else is going on. I also tried running that ctests in your error log, but it can't even seem to find tests in my build directory.

@wbehrens-on-gh
Copy link

so are ctests not running for you? there may be a cmake flag you have to pass to enable tests.

@NickSica
Copy link
Author

so are ctests not running for you? there may be a cmake flag you have to pass to enable tests.

I've built it with all the same cmake flags as the nix package. I think the nix package is explicitly running the ctests. I'll see if I can get them running but I'm not sure if Prusa even uses them.

@lixxbox
Copy link

lixxbox commented Aug 30, 2023

Has anyone tested this successfully?

I have compiled the PR under Windows and Linux.
I configured the Mars 3 Pro and sliced a simple cube and exported it as "Chitubox v4 .ctb". Both generated versions (from win+linux) are unknown file formats on the Mars 3.
I then opened the ctb files in uvtools, as it keeps "complaining" about encrypted files and this message does not appear for the files created by PrusaSlicer.
Is there anything else I need to be aware of?

@NickSica
Copy link
Author

NickSica commented Aug 30, 2023

Has anyone tested this successfully?

I have compiled the PR under Windows and Linux. I configured the Mars 3 Pro and sliced a simple cube and exported it as "Chitubox v4 .ctb". Both generated versions (from win+linux) are unknown file formats on the Mars 3. I then opened the ctb files in uvtools, as it keeps "complaining" about encrypted files and this message does not appear for the files created by PrusaSlicer. Is there anything else I need to be aware of?

Does UVTools open the file successfully? Or does it just not complain about it being encrypted(which is correct since I didn't implement the encryption portion)

Can you also provide the stl and ctb files? It'll help me figure out what's wrong when I have some time.

Oh actually you know what it could be is the configuration for the mars 3 I might've not put in actual good numbers for it.
A quick glance and I think I did set it up right. I also just saw you configured the Mars 3 Pro yourself. Can you provide the configuration?

@NickSica NickSica closed this Aug 30, 2023
@NickSica NickSica reopened this Aug 30, 2023
@lixxbox
Copy link

lixxbox commented Aug 30, 2023

Yeah, UVtools opens the file successfully

I added the default cube from PrusaSlicer, so no stl, but I have uploaded the 3mf project, which also should contain the config (?).
Shape-Box.zip
All I did was adding the Mars 3 Pro via configuration wizard and enabled hollowing.

Hope this helps. Let me know if you need anything else. :-)

Shape-Box_properties.zip (from UV tools)
Not sure what the magic number is, but on files sliced from Chitubox it is: 318570759, PrusaSlicer: 318570630

@NickSica
Copy link
Author

Yeah, UVtools opens the file successfully

I added the default cube from PrusaSlicer, so no stl, but I have uploaded the 3mf project, which also should contain the config (?). Shape-Box.zip All I did was adding the Mars 3 Pro via configuration wizard and enabled hollowing.

Hope this helps. Let me know if you need anything else. :-)

Shape-Box_properties.zip (from UV tools) Not sure what the magic number is, but on files sliced from Chitubox it is: 318570759, PrusaSlicer: 318570630

Huh this is weird since chitubox even opens the ctb file. I think you may be right about the magic number.

@NickSica
Copy link
Author

Yeah, UVtools opens the file successfully

I added the default cube from PrusaSlicer, so no stl, but I have uploaded the 3mf project, which also should contain the config (?). Shape-Box.zip All I did was adding the Mars 3 Pro via configuration wizard and enabled hollowing.

Hope this helps. Let me know if you need anything else. :-)

Shape-Box_properties.zip (from UV tools) Not sure what the magic number is, but on files sliced from Chitubox it is: 318570759, PrusaSlicer: 318570630

Can you try the new changes I made? I also changed float_t to float to align with #11036

@lixxbox
Copy link

lixxbox commented Aug 30, 2023

I'll give it a try.
I have hard times with git and compiling PS on Windows. It took me several days (and luck) to get it working. Currently it doesn't build anymore.

@NickSica
Copy link
Author

I'll give it a try. I have hard times with git and compiling PS on Windows. It took me several days (and luck) to get it working. Currently it doesn't build anymore.

I honestly think that may be due to the build system setup. I've had to delete the build folders multiple times sometimes to get it to build correctly sometimes.

@NickSica
Copy link
Author

NickSica commented Aug 30, 2023

I'll give it a try. I have hard times with git and compiling PS on Windows. It took me several days (and luck) to get it working. Currently it doesn't build anymore.

Ok so my builds were failing until I added #include tbb/parallel_for.h to src/libslic3r/Measure.cpp and #include boost/log/trivial.hpp tp src/libslic3r/CutUtils.cpp. These aren't files I've touched so I'm curious if the github has a bug in it. Yet another issue CI could prevent.

@NickSica
Copy link
Author

NickSica commented Aug 30, 2023

I'll give it a try. I have hard times with git and compiling PS on Windows. It took me several days (and luck) to get it working. Currently it doesn't build anymore.

Sorry one more change adding #include libslic3r/ClipperUtils.hpp to src/slic3r/GUI/TextLines.cpp

EDIT:
This and the above changes align with #11218

@lixxbox
Copy link

lixxbox commented Aug 31, 2023

Okay, I managed to build PS again*. However, the printer still does not recognise the file. Shape-Box2.zip
According to UVtools, the magic number still doesn't match. It is 318570758 instead of 318570759.

* by randomly running the manual steps and the build script, I haven't found a way to build it reliably on the first try.

Edit:
I did the following. I converted the above ctb file with uvtools to:

Format Magic number Mars 3 Pro
chitubox ctb" v4 318570630 invalid
chitubox ctb encrypted" v4 318570759 success

Is it possible that the Mars 3 does not support unencrypted files?
Shape-Box2uv.zip

Edit2:
Exported a cube from Lychee Slicer. cube-lychee.zip
Magic number: 318570759
No Encryption (uvtools doesn't show the message)
Works with Mars 3 Pro.

@NickSica
Copy link
Author

NickSica commented Sep 2, 2023

FYI: Build fails under Windows.

Details
I'm on your latest commit. I have completely rebuilt the dependencies.

grafik File (include) cannot be opened: "openssl/sha.h"

PrusaSlicer has openssl as a dependency so that shouldn't be an issue. I'm building from another machine to test and I'm seeing this issue now. It's weird it isn't picking up openssl in the dependencies. The encryption still isn't working 100% anyways.

@NickSica
Copy link
Author

NickSica commented Sep 5, 2023

FYI: Build fails under Windows.

Details

Hey, it should be working now. Did you ever get the build with openssl working? One thing to note is you won't be able to open the files in UVtools(until I get this bug fix pushed to UVtools) or chitubox. I'll eventually probably change it so it opens in chitubox, but supporting that isn't high on my priority list. I changed it so the hash is at the end so it should open in UVtools. I could not get the file to open in Chitubox. Let me know if everything works.

@NickSica NickSica changed the title Implement support for CTB files Implement support for CTBv4 and encrypted CTB files Sep 5, 2023
@lixxbox
Copy link

lixxbox commented Sep 8, 2023

I am still struggling to build the project (Windows). Oddly, I have no problems building a pure PrusaSlicer (without your changes). I can't tell you what the problem is at the moment. But I keep trying. 🤞

@NickSica
Copy link
Author

NickSica commented Sep 8, 2023

I am still struggling to build the project (Windows). Oddly, I have no problems building a pure PrusaSlicer (without your changes). I can't tell you what the problem is at the moment. But I keep trying. 🤞

Did you pull the latest changes? What error are you getting?

@lixxbox
Copy link

lixxbox commented Sep 8, 2023

Yes, i have freshly cloned your master.
grafik

When I try to build the dependencies, I get the following message. Regardless of whether I use the manual method or build_win.bat

CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineSystem.cmake:154 (message):
  Could not find toolchain file: /scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  CMakeLists.txt:27 (project)

I have also just repaired and updated my visual studio installation, unfortunately no improvement.

@NickSica
Copy link
Author

NickSica commented Sep 8, 2023

Yes, i have freshly cloned your master. grafik

When I try to build the dependencies, I get the following message. Regardless of whether I use the manual method or build_win.bat

CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeDetermineSystem.cmake:154 (message):
  Could not find toolchain file: /scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  CMakeLists.txt:27 (project)

I have also just repaired and updated my visual studio installation, unfortunately no improvement.

Ah you're talking about the Windows builds... Are you certain you're using Visual Studio 22? The vcpkg stuff I added is a new feature with that.

@mbudnek
Copy link

mbudnek commented Sep 9, 2023

Are you certain you're using Visual Studio 22? The vcpkg stuff I added is a new feature with that.

The build documentation says PrusaSlicer uses Visual Studio 2019, so using 2022-only features is very likely to be an issue.

@NickSica
Copy link
Author

NickSica commented Sep 9, 2023

Are you certain you're using Visual Studio 22? The vcpkg stuff I added is a new feature with that.

The build documentation says PrusaSlicer uses Visual Studio 2019, so using 2022-only features is very likely to be an issue.

I mean Prusa has shown 0 interest in merging this to their repo so I was just adding it what made it work for me and others. There is a way to download it before VS2022, but I didn't want to put that much work into it if it works for 2022(since 2022 is free anyways) for the time being. I'm trying to generate builds using the github actions on my branch. If anyone wants to figure out how to get OpenSSL to build on windows without vcpkg be my guest but this was so much easier.

@lixxbox
Copy link

lixxbox commented Sep 9, 2023

I used VS 2019 on purpose, as I also followed the official instructions.
When I append -v=17, I get error: C1060 "compiler is out of heap space".

EDIT: Did some system cleanup and a reboot. Now it works.

build_win.bat -d=..\PrusaSlicer-deps -r=console -s=all -v=17

I would like to avoid bloating the discussion unnecessarily with my compiler problems. 😂

@NickSica
Copy link
Author

NickSica commented Sep 9, 2023

I used VS 2019 on purpose, as I also followed the official instructions. When I append -v=17, I get error: C1060 "compiler is out of heap space".

build_win.bat -d=..\PrusaSlicer-deps -r=console -s=all -v=17

I would like to avoid bloating the discussion unnecessarily with my compiler problems. 😂

Nah this helps me figure out the windows build because while it builds on my windows machine, it's a bit overkill so it might not build on something like the github actions machines(which is getting the same error). On the bright side the linux builds work pretty consistently.

@lixxbox
Copy link

lixxbox commented Sep 9, 2023

I have just exported a file.

  • uvtools opens the file.
  • chitubox says invalid file.
    logfile has no error, just:
2023/09/09-11:46:32:  ready to load: "C:\\Users\\lixxbox\\Downloads\\Shape-Box-encrypted test.ctb"
2023/09/09-11:46:32:  loadFileName: "C:\\Users\\lixxbox\\Downloads\\Shape-Box-encrypted test.ctb"
2023/09/09-11:46:32:  file Magic Num 12fd0107
  • Mars 3 says "Invalid file format", but also appends "-008", that wasn't the case with previous files.

@NickSica
Copy link
Author

NickSica commented Sep 9, 2023

I have just exported a file.

  • uvtools opens the file.
  • chitubox says invalid file.
    logfile has no error, just:
2023/09/09-11:46:32:  ready to load: "C:\\Users\\lixxbox\\Downloads\\Shape-Box-encrypted test.ctb"
2023/09/09-11:46:32:  loadFileName: "C:\\Users\\lixxbox\\Downloads\\Shape-Box-encrypted test.ctb"
2023/09/09-11:46:32:  file Magic Num 12fd0107
  • Mars 3 says "Invalid file format", but also appends "-008", that wasn't the case with previous files.

Ok I expected the chitubox to not work but the Mars 3 D: that's disheartening.

@lixxbox
Copy link

lixxbox commented Sep 9, 2023

I don't really know anything about the file format,
but what I have tested:

I converted the CTB from PrusaSlicer to an encrypted CTB with uvtools. Then i compared the two headers. I also compared the header with a CTB from Chitubox.

It is noticeable that the "Unknown" values in the PrusaSlicer file are all 0, and the values of the other two files are identical.

PrusaSlicer Uvtools Chitubox
Magic 318570759 318570759 318570759
SettingsSize 288 288 288
SettingsOffset 48 48 48
Unknown1 0 0 0
Unknown2 0 4 4
SignatureSize 32 32 32
SignatureOffset 1849866 1849874 12843789
Unknown 0 0 0
Unknown4 0 1 1
Unknown5 0 1 1
Unknown6 0 0 0
Unknown7 0 42 42
Unknown8 0 0 0

There are also differing "Unknown" and "Padding" values under SlicerSettings.

PrusaSlicer Uvtools Chitubox
Padding 0 0 0
Padding1 0 0 0
Padding2 1082130432 0 0
Padding3 405 0 0
Padding4 0 0 0
Padding5 0 0 0
Padding6 0 0 0
Padding7 320 0 1
Padding8 0 0 0
Padding9 0 0 0
Padding10 0 0 0
Unknown1 0 0 0
Unknown2 0 0 0
Unknown3 0 1 1
Unknown4 256 0 0
Unknown5 0 8 8
Unknown6 0 0 1152677888
Unknown7 1161347056 0 32402
Unknown8 73470 4 4

@NickSica
Copy link
Author

NickSica commented Sep 9, 2023

I don't really know anything about the file format, but what I have tested:

I converted the CTB from PrusaSlicer to an encrypted CTB with uvtools. Then i compared the two headers. I also compared the header with a CTB from Chitubox.

It is noticeable that the "Unknown" values in the PrusaSlicer file are all 0, and the values of the other two files are identical.

PrusaSlicer Uvtools Chitubox
Magic 318570759 318570759 318570759
SettingsSize 288 288 288
SettingsOffset 48 48 48
Unknown1 0 0 0
Unknown2 0 4 4
SignatureSize 32 32 32
SignatureOffset 1849866 1849874 12843789
Unknown 0 0 0
Unknown4 0 1 1
Unknown5 0 1 1
Unknown6 0 0 0
Unknown7 0 42 42
Unknown8 0 0 0
There are also differing "Unknown" and "Padding" values under SlicerSettings.

PrusaSlicer Uvtools Chitubox
Padding 0 0 0
Padding1 0 0 0
Padding2 1082130432 0 0
Padding3 405 0 0
Padding4 0 0 0
Padding5 0 0 0
Padding6 0 0 0
Padding7 320 0 1
Padding8 0 0 0
Padding9 0 0 0
Padding10 0 0 0
Unknown1 0 0 0
Unknown2 0 0 0
Unknown3 0 1 1
Unknown4 256 0 0
Unknown5 0 8 8
Unknown6 0 0 1152677888
Unknown7 1161347056 0 32402
Unknown8 73470 4 4

Yeah I kinda kept them the same as the regular ctb. They might have an actual use though to chitubox. Anything's possible with their file format. This side by side comparison is helpful though for me to track down any different values and fix them, thank you.

I'm also pretty sure I set all my paddings to 0 so there might be another bug in there as well I need to look for.

@lixxbox
Copy link

lixxbox commented Sep 10, 2023

Yesterday i filtered out some fields, but i looked at the whole table again today.

It looks like the value "405" in padding3 in the lower part doesn't belong there and therefore the values for DisclaimerOffset, DisclaimerSize and Padding7 have been "shifted". The position seems to be corrected during the conversion of uvtools.

In the code you set unknown7 to value 73470, but uvtools interprets it as unknown8.
https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L391

PerLayerSettings should be zero, but is 64
https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L377

Something seems definitely off.

The value of BottomRetractSpeed (= 1.1E-44) also doesn't look correct. uvtools reads it like this.

Prusa uv chitu
[FileHeader]
Magic 318570759 318570759 318570759
SettingsSize 288 288 288
SettingsOffset 48 48 48
Unknown1 0 0 0
Unknown2 0 4 4
SignatureSize 32 32 32
SignatureOffset 1849866 1849874 12843789
Unknown 0 0 0
Unknown4 0 1 1
Unknown5 0 1 1
Unknown6 0 0 0
Unknown7 0 42 42
Unknown8 0 0 0
[SlicerSettings]
ChecksumValue 3405691582 3405691582 1693720481
LayerPointersOffset 21176 21184 8067
DisplayWidth  143.43  143.43  143.43
DisplayHeight  89.6  89.6  89.6
MachineZ 175 175 175
Unknown1 0 0 0
Unknown2 0 0 0
TotalHeightMillimeter 0  20.3 20
LayerHeight  0.05  0.05  0.05
ExposureTime 10 10  2.5
BottomExposureTime 35 35 35
LightOffDelay 2 0 0
BottomLayerCount 8 8 5
ResolutionX 4098 4098 4098
ResolutionY 2560 2560 2560
LayerCount 406 406 400
LargePreviewOffset 336 336 336
SmallPreviewOffset 14094 14098 5742
PrintTime 23982 23982 3821
ProjectorType 1 1 1
BottomLiftHeight 8 8 5
BottomLiftSpeed 45 45 60
LiftHeight 8 8 5
LiftSpeed 45 45 80
RetractSpeed 45 45 210
MaterialMilliliters 3.531 3.531 19.027
MaterialGrams 1000 1000 20.715.807
MaterialCost  0.212  0.212  0.6129807
BottomLightOffDelay 3 0 0
Unknown3 0 1 1
LightPWM 255 255 255
BottomLightPWM 255 255 255
LayerXorKey 0 4022250974 4010442874
BottomLiftHeight2 0 0 0
BottomLiftSpeed2 0 0 0
LiftHeight2 0 0 0
LiftSpeed2 45 45 0
RetractHeight2 0 0 0
RetractSpeed2 0 0 0
RestTimeAfterLift 1 1 0
MachineNameOffset 20846 20854 7730
MachineNameSize 10 10 17
AntiAliasFlag 7 15 15
Padding 0 0 0
PerLayerSettings 64 64 0
Unknown4 256 0 0
Unknown5 0 8 8
RestTimeAfterRetract 0 0  0.5
RestTimeAfterLift2 1 1 0
TransitionLayerCount 1065353216 0 5
BottomRetractSpeed  1.1E-44 0 210
BottomRetractSpeed2 45 45 0
Padding1 0 0 0
Four1 0 4 4
Padding2 1082130432 0 0
Four2 0 4 4
RestTimeAfterRetract2 4 0  0.5
RestTimeAfterLift3 1 1 0
RestTimeBeforeLift 1 1 0
BottomRetractHeight2 0 0 0
Unknown6 0 0 1152677888
* Unknown7 1161347056 0 32402
* Unknown8 73470 4 4
LastLayerIndex 405 405 399
* Padding3 405 0 0
Padding4 0 0 0
Padding5 0 0 0
Padding6 0 0 0
* DisclaimerOffset 0 20864 7747
* DisclaimerSize 20856 320 320
* Padding7 320 0 1
Padding8 0 0 0
Padding9 0 0 0
Padding10 0 0 0
MachineName  MARS3PRO4K  MARS3PRO4K  ELEGOO MARS 3 PRO

@NickSica
Copy link
Author

Yesterday i filtered out some fields, but i looked at the whole table again today.

It looks like the value "405" in padding3 in the lower part doesn't belong there and therefore the values for DisclaimerOffset, DisclaimerSize and Padding7 have been "shifted". The position seems to be corrected during the conversion of uvtools.

In the code you set unknown7 to value 73470, but uvtools interprets it as unknown8. https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L391

PerLayerSettings should be zero, but is 64 https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L377

Something seems definitely off.

The value of BottomRetractSpeed (= 1.1E-44) also doesn't look correct. uvtools reads it like this.

Prusa uv chitu
[FileHeader]
Magic 318570759 318570759 318570759
SettingsSize 288 288 288
SettingsOffset 48 48 48
Unknown1 0 0 0
Unknown2 0 4 4
SignatureSize 32 32 32
SignatureOffset 1849866 1849874 12843789
Unknown 0 0 0
Unknown4 0 1 1
Unknown5 0 1 1
Unknown6 0 0 0
Unknown7 0 42 42
Unknown8 0 0 0
[SlicerSettings]
ChecksumValue 3405691582 3405691582 1693720481
LayerPointersOffset 21176 21184 8067
DisplayWidth  143.43  143.43  143.43
DisplayHeight  89.6  89.6  89.6
MachineZ 175 175 175
Unknown1 0 0 0
Unknown2 0 0 0
TotalHeightMillimeter 0  20.3 20
LayerHeight  0.05  0.05  0.05
ExposureTime 10 10  2.5
BottomExposureTime 35 35 35
LightOffDelay 2 0 0
BottomLayerCount 8 8 5
ResolutionX 4098 4098 4098
ResolutionY 2560 2560 2560
LayerCount 406 406 400
LargePreviewOffset 336 336 336
SmallPreviewOffset 14094 14098 5742
PrintTime 23982 23982 3821
ProjectorType 1 1 1
BottomLiftHeight 8 8 5
BottomLiftSpeed 45 45 60
LiftHeight 8 8 5
LiftSpeed 45 45 80
RetractSpeed 45 45 210
MaterialMilliliters 3.531 3.531 19.027
MaterialGrams 1000 1000 20.715.807
MaterialCost  0.212  0.212  0.6129807
BottomLightOffDelay 3 0 0
Unknown3 0 1 1
LightPWM 255 255 255
BottomLightPWM 255 255 255
LayerXorKey 0 4022250974 4010442874
BottomLiftHeight2 0 0 0
BottomLiftSpeed2 0 0 0
LiftHeight2 0 0 0
LiftSpeed2 45 45 0
RetractHeight2 0 0 0
RetractSpeed2 0 0 0
RestTimeAfterLift 1 1 0
MachineNameOffset 20846 20854 7730
MachineNameSize 10 10 17
AntiAliasFlag 7 15 15
Padding 0 0 0
PerLayerSettings 64 64 0
Unknown4 256 0 0
Unknown5 0 8 8
RestTimeAfterRetract 0 0  0.5
RestTimeAfterLift2 1 1 0
TransitionLayerCount 1065353216 0 5
BottomRetractSpeed  1.1E-44 0 210
BottomRetractSpeed2 45 45 0
Padding1 0 0 0
Four1 0 4 4
Padding2 1082130432 0 0
Four2 0 4 4
RestTimeAfterRetract2 4 0  0.5
RestTimeAfterLift3 1 1 0
RestTimeBeforeLift 1 1 0
BottomRetractHeight2 0 0 0
Unknown6 0 0 1152677888

  • Unknown7 1161347056 0 32402
  • Unknown8 73470 4 4
    LastLayerIndex 405 405 399
  • Padding3 405 0 0
    Padding4 0 0 0
    Padding5 0 0 0
    Padding6 0 0 0
  • DisclaimerOffset 0 20864 7747
  • DisclaimerSize 20856 320 320
  • Padding7 320 0 1
    Padding8 0 0 0
    Padding9 0 0 0
    Padding10 0 0 0
    MachineName  MARS3PRO4K  MARS3PRO4K  ELEGOO MARS 3 PRO

Yeah I noticed the shift I just need to dig into it more. Having it all laid out for me will help while I'm exploring the issue, thank you. I was trying to figure out the issue with the windows build, but I may just need to split the .c files into separate ones to fix that.

@NickSica
Copy link
Author

NickSica commented Sep 11, 2023

Yesterday i filtered out some fields, but i looked at the whole table again today.

It looks like the value "405" in padding3 in the lower part doesn't belong there and therefore the values for DisclaimerOffset, DisclaimerSize and Padding7 have been "shifted". The position seems to be corrected during the conversion of uvtools.

In the code you set unknown7 to value 73470, but uvtools interprets it as unknown8. https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L391

PerLayerSettings should be zero, but is 64 https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L377

Something seems definitely off.

The value of BottomRetractSpeed (= 1.1E-44) also doesn't look correct. uvtools reads it like this.

Prusa uv chitu
[FileHeader]
Magic 318570759 318570759 318570759
SettingsSize 288 288 288
SettingsOffset 48 48 48
Unknown1 0 0 0
Unknown2 0 4 4
SignatureSize 32 32 32
SignatureOffset 1849866 1849874 12843789
Unknown 0 0 0
Unknown4 0 1 1
Unknown5 0 1 1
Unknown6 0 0 0
Unknown7 0 42 42
Unknown8 0 0 0
[SlicerSettings]
ChecksumValue 3405691582 3405691582 1693720481
LayerPointersOffset 21176 21184 8067
DisplayWidth  143.43  143.43  143.43
DisplayHeight  89.6  89.6  89.6
MachineZ 175 175 175
Unknown1 0 0 0
Unknown2 0 0 0
TotalHeightMillimeter 0  20.3 20
LayerHeight  0.05  0.05  0.05
ExposureTime 10 10  2.5
BottomExposureTime 35 35 35
LightOffDelay 2 0 0
BottomLayerCount 8 8 5
ResolutionX 4098 4098 4098
ResolutionY 2560 2560 2560
LayerCount 406 406 400
LargePreviewOffset 336 336 336
SmallPreviewOffset 14094 14098 5742
PrintTime 23982 23982 3821
ProjectorType 1 1 1
BottomLiftHeight 8 8 5
BottomLiftSpeed 45 45 60
LiftHeight 8 8 5
LiftSpeed 45 45 80
RetractSpeed 45 45 210
MaterialMilliliters 3.531 3.531 19.027
MaterialGrams 1000 1000 20.715.807
MaterialCost  0.212  0.212  0.6129807
BottomLightOffDelay 3 0 0
Unknown3 0 1 1
LightPWM 255 255 255
BottomLightPWM 255 255 255
LayerXorKey 0 4022250974 4010442874
BottomLiftHeight2 0 0 0
BottomLiftSpeed2 0 0 0
LiftHeight2 0 0 0
LiftSpeed2 45 45 0
RetractHeight2 0 0 0
RetractSpeed2 0 0 0
RestTimeAfterLift 1 1 0
MachineNameOffset 20846 20854 7730
MachineNameSize 10 10 17
AntiAliasFlag 7 15 15
Padding 0 0 0
PerLayerSettings 64 64 0
Unknown4 256 0 0
Unknown5 0 8 8
RestTimeAfterRetract 0 0  0.5
RestTimeAfterLift2 1 1 0
TransitionLayerCount 1065353216 0 5
BottomRetractSpeed  1.1E-44 0 210
BottomRetractSpeed2 45 45 0
Padding1 0 0 0
Four1 0 4 4
Padding2 1082130432 0 0
Four2 0 4 4
RestTimeAfterRetract2 4 0  0.5
RestTimeAfterLift3 1 1 0
RestTimeBeforeLift 1 1 0
BottomRetractHeight2 0 0 0
Unknown6 0 0 1152677888

  • Unknown7 1161347056 0 32402
  • Unknown8 73470 4 4
    LastLayerIndex 405 405 399
  • Padding3 405 0 0
    Padding4 0 0 0
    Padding5 0 0 0
    Padding6 0 0 0
  • DisclaimerOffset 0 20864 7747
  • DisclaimerSize 20856 320 320
  • Padding7 320 0 1
    Padding8 0 0 0
    Padding9 0 0 0
    Padding10 0 0 0
    MachineName  MARS3PRO4K  MARS3PRO4K  ELEGOO MARS 3 PRO

I found the issue, I'm just trying to figure out what's going on cuz it's writing an extra byte of 0s when it shouldn't be at the anti_alias_flag. I managed to observe it by filling 0 values with garbage. I also fixed a couple other bugs on the way like the light intensity not being right. Should have a new version by tonight if I figure out this weird bug.

@NickSica
Copy link
Author

Yesterday i filtered out some fields, but i looked at the whole table again today.

It looks like the value "405" in padding3 in the lower part doesn't belong there and therefore the values for DisclaimerOffset, DisclaimerSize and Padding7 have been "shifted". The position seems to be corrected during the conversion of uvtools.

In the code you set unknown7 to value 73470, but uvtools interprets it as unknown8. https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L391

PerLayerSettings should be zero, but is 64 https://github.com/NickSica/PrusaSlicer/blob/52e181b2aa16ce7bc936f433c4e57acca7c5ac64/src/libslic3r/Format/CTB.cpp#L377

Something seems definitely off.

The value of BottomRetractSpeed (= 1.1E-44) also doesn't look correct. uvtools reads it like this.

Prusa uv chitu
[FileHeader]
Magic 318570759 318570759 318570759
SettingsSize 288 288 288
SettingsOffset 48 48 48
Unknown1 0 0 0
Unknown2 0 4 4
SignatureSize 32 32 32
SignatureOffset 1849866 1849874 12843789
Unknown 0 0 0
Unknown4 0 1 1
Unknown5 0 1 1
Unknown6 0 0 0
Unknown7 0 42 42
Unknown8 0 0 0
[SlicerSettings]
ChecksumValue 3405691582 3405691582 1693720481
LayerPointersOffset 21176 21184 8067
DisplayWidth  143.43  143.43  143.43
DisplayHeight  89.6  89.6  89.6
MachineZ 175 175 175
Unknown1 0 0 0
Unknown2 0 0 0
TotalHeightMillimeter 0  20.3 20
LayerHeight  0.05  0.05  0.05
ExposureTime 10 10  2.5
BottomExposureTime 35 35 35
LightOffDelay 2 0 0
BottomLayerCount 8 8 5
ResolutionX 4098 4098 4098
ResolutionY 2560 2560 2560
LayerCount 406 406 400
LargePreviewOffset 336 336 336
SmallPreviewOffset 14094 14098 5742
PrintTime 23982 23982 3821
ProjectorType 1 1 1
BottomLiftHeight 8 8 5
BottomLiftSpeed 45 45 60
LiftHeight 8 8 5
LiftSpeed 45 45 80
RetractSpeed 45 45 210
MaterialMilliliters 3.531 3.531 19.027
MaterialGrams 1000 1000 20.715.807
MaterialCost  0.212  0.212  0.6129807
BottomLightOffDelay 3 0 0
Unknown3 0 1 1
LightPWM 255 255 255
BottomLightPWM 255 255 255
LayerXorKey 0 4022250974 4010442874
BottomLiftHeight2 0 0 0
BottomLiftSpeed2 0 0 0
LiftHeight2 0 0 0
LiftSpeed2 45 45 0
RetractHeight2 0 0 0
RetractSpeed2 0 0 0
RestTimeAfterLift 1 1 0
MachineNameOffset 20846 20854 7730
MachineNameSize 10 10 17
AntiAliasFlag 7 15 15
Padding 0 0 0
PerLayerSettings 64 64 0
Unknown4 256 0 0
Unknown5 0 8 8
RestTimeAfterRetract 0 0  0.5
RestTimeAfterLift2 1 1 0
TransitionLayerCount 1065353216 0 5
BottomRetractSpeed  1.1E-44 0 210
BottomRetractSpeed2 45 45 0
Padding1 0 0 0
Four1 0 4 4
Padding2 1082130432 0 0
Four2 0 4 4
RestTimeAfterRetract2 4 0  0.5
RestTimeAfterLift3 1 1 0
RestTimeBeforeLift 1 1 0
BottomRetractHeight2 0 0 0
Unknown6 0 0 1152677888

  • Unknown7 1161347056 0 32402
  • Unknown8 73470 4 4
    LastLayerIndex 405 405 399
  • Padding3 405 0 0
    Padding4 0 0 0
    Padding5 0 0 0
    Padding6 0 0 0
  • DisclaimerOffset 0 20864 7747
  • DisclaimerSize 20856 320 320
  • Padding7 320 0 1
    Padding8 0 0 0
    Padding9 0 0 0
    Padding10 0 0 0
    MachineName  MARS3PRO4K  MARS3PRO4K  ELEGOO MARS 3 PRO

Chitubox is now loading the encrypted CTB! That means that it SHOULD work. Let me know if it actually does on your printer and I'd sit by it during the first print just in case(I don't think there should be any issues)

@lixxbox
Copy link

lixxbox commented Sep 12, 2023

I can confirm that it builds without problems and that created CTB files can be opened in Chitubox and UVtools. 👌

Later I will take a closer look at the "SlicerSettings" and check them for plausibility and then start a test print.

@lixxbox
Copy link

lixxbox commented Sep 12, 2023

Congrats! 😄 The CTB is accepted by the Mars 3 Pro and printing begins. However, I cancelled it, because I still want to compare the values in the header with the slicer settings. I haven't had time to do that yet.

@NickSica
Copy link
Author

NickSica commented Sep 12, 2023

Congrats! 😄 The CTB is accepted by the Mars 3 Pro and printing begins. However, I cancelled it, because I still want to compare the values in the header with the slicer settings. I haven't had time to do that yet.

Finally haha it was an issue with the struct not being packed(something I documented worry about awhile ago). It'd be cool if we can figure out what some of the unknowns actually equate to in the long run(knowing chitu it may just be random nonsense).

Lastly for anyone else following this thread I'll likely continue working on my fork and adding features to that which won't be reflected in this pull request. Hopefully I can bring them to PrusaSlicer eventually, but with the closed off development that's been a recent thing with PrusaSlicer I'm not banking on that fact. My main targets will be slowly implementing stuff from UVtools and the custom vat mixing GCode from TableFlipFoundry into it. Then eventually implementing GOO files and printer uploads. If anyone would like to take part feel free to open any issues and pull requests in the fork(I'll probably start a new branch called dev or something).

profiles, and extra features like light off delay to MSLA printer settings

Adds CTB format

Fixes CTB format

Adds more configurations for the new SLA options in PrintConfig

Adds page number calculation

Adds model height calculation

Adds more GUI elements for configuration options and fixes missing options

Fixes type errors with configuration

Fixes PWM calculation to be 0-255

Adds configuration for Elegoo SLA printers to Elegoo.ini

Fixes configuration issues for Elegoo printers

Fixes typo

Adds configuration options to Preset.cpp

Changes default file format for Elegoo SLA printers to ctb

Fixes some structuring issues and generic function for getting config values

Adds ctb to sla file filters

Adds ctb to the ArchiveWriter

Fixes thumbnail sizes in Elegoo config to match the usual size

Adds RLE encoding to thumbnails

Changes grouping for SLA settings

Adds new settings to the steps check

Fixes a lot of bugs in file writing

Fixes missing configuration

Puts TSMC options on the same line

Fixes more bugs in data write

Fixes a bug in layer generation

Fixes the options tab not being set up right and crashing

Fixes indentation

Cleans up the header file a bit

Fixes the Elegoo SLA printer configurations

Fixes the thumbnail

Change CTB to use SLAArchiveFormatRegistry

Add retract_height to configuration

Change configuration to grey out TSMC options when disabled and keep retract parameters equal to lift distance

Fix formatting to follow clang-format

Fix the name of a configuration option in the toggle logic

Change float_t to float
Fix magic number for CTBv4

Change float_t to float

Change from ctb to CTB to emulate other file format setups

Add encrypted CTB. Have not tested too much, here be dragons.

Add openssl and crypto to CMake file

Fix multiple errors, getting closer

Fix more bugs, still not quite right

Fix encrypted CTB files.
UVtools has a bug currently where it expects the signature at the end.
Chitubox may have the same bug which is why it won't load it.

Move hash to the end and add XOR cipher. Files still don't open in chitubox for some reason.

Change PAGE_SIZE to CTB_PAGE_SIZE so it is unique

Fix openssl include and change PAGE_SIZE to CTB_PAGE_SIZE

Fix CMakeLists to include openssl correctly

Fix TSMC option bug

Fix several bugs and the CTBv4 output. Chitubox now loads the encrypted ctb file!

Move some includes to .cpp file to try and fix some RAM usage on windows build

Fixes Elegoo profiles

Add skipped changes from rebase(bug fixes apparently) and disable clang format on files that aren't clang formatted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement support for CTBv3 (Elegoo Mars 2 Pro/Phrozen Sonic Mini 4K)
6 participants