Skip to content
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

Implement support for CTBv4 and encrypted CTB files #10531

Open
wants to merge 60 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.

@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).

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