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
base: master
Are you sure you want to change the base?
Conversation
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? |
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. |
I used VS 2019 on purpose, as I also followed the official instructions. EDIT: Did some system cleanup and a reboot. Now it works.
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. |
I have just exported a file.
|
Ok I expected the chitubox to not work but the Mars 3 D: that's disheartening. |
I don't really know anything about the file format, 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.
There are also differing "Unknown" and "Padding" values under SlicerSettings.
|
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. |
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. PerLayerSettings should be zero, but is 64 Something seems definitely off. The value of BottomRetractSpeed (= 1.1E-44) also doesn't look correct. uvtools reads it like this.
|
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. |
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. |
… wrong(a side effect of the GUI fixes)
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) |
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. |
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). |
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.