Photonsters / PhotonS

repository for all things Photon S
The Unlicense
30 stars 5 forks source link

Documentation for PWS File Format #1

Open robfitz273k opened 5 years ago

robfitz273k commented 5 years ago

Here's the beginning of documentation for the PWS File Format reverse engineered from the R_E_R_F.pws file.

X3msnake commented 5 years ago

Greetings Master @robfitz273k thanks for the commit

We have the official source code for the file type from anycubic here: https://github.com/Photonsters/anycubic-photon-docs/blob/dev/Temp-resources/2019-03-05%20photons%202.0%20file%20format.pdf

What is your FB name so we can talk

gcarret commented 5 years ago

Hi @robfitz273k I would be interested by the Java programs you wrote to read the images. I'm currently working on a PCB gerber -> PWS converter and I don't fully understand the Layers format.

Ordenritterlein commented 5 years ago

@gcarret It basically works the same as the "old" .photon/cbddlp format. its run length encoding, so it counts down lengths of same-colored pixels up to a max of 125, last bit is color and the rest are how many pixels of that color are encoded by that byte. (if you look at a file in a hex-editor, they limit to 125, even though they could encode 127...) for Antialiasing, which you probably won't use, just count down 1440 * 2560 px and then the new sub-layer starts, no extra header or anything. Hope that helps.

I'm working on a converter between the three file types the photons use (->https://github.com/Ordenritterlein/PhotonsFileConverter) pws support will be up there in a few days hopefully)

gcarret commented 5 years ago

@Ordenritterlein Thanks a lot. I couldn't understand why they stopped at 125. I didn't see the link with the antialiasing, since there is also a global parameter for that ... Much clearer now !

dStruct commented 4 years ago

Have you guys considered maybe exploring ways to pull the software from the controller board? It might actually be very easy and possible and then you could evaluate the other side of the equation. What the controller is expecting from the file(s).

I would very much like to see this evolve since the latest Photon Workshop is complete garbage, first time I used it on Windows 10 it crashed twice manually adding supports.

Fusion 360 now fully supports 3D printing, slicing, and supports. I would really really love to see a module to Fusion 360 based on what you guys are doing here for the Photon S.

X3msnake commented 4 years ago

@dStruct use chitubox or prusaslicer with the tool to convert sl1 to your machine.

Extracting the firmware from teh controller will lead nowhere you cannot get source from a binary file that is on the FPGA or the STM32

dStruct commented 4 years ago

@dStruct use chitubox or prusaslicer with the tool to convert sl1 to your machine.

Extracting the firmware from teh controller will lead nowhere you cannot get source from a binary file that is on the FPGA or the STM32

Thanks for the reply @X3msnake, yeah currently I just use Chitubox. On the latest AnyCubic firmware they re-added support for .photon files, so I'm just doing supports and slicing in Chitubox and using the .photon format. I did notice Chitubox is missing some of the parameters for a few things relating to machine setup like Anti-alias I think was one of them, when compared to Photon Workshop.

I see you have some experience working with Fusion 360 Post Processing modules, that is exactly what I'm hoping someone develops for the AnyCubic line of SLA printers, from initial glance it looks like Fusion has the ability to do a much better job at supports and slicing then even Chitubox (not that it's not great). Given the fact that a lot of information is out there relating to the .photon format which is now supported again, I hope a Fusion post module becomes a reality at some point.

X3msnake commented 4 years ago

@dStruct actually i was not aware that F360 had 3D printing untill i read your comments. a quick search on the web and it seems like it only has path based slicing at the moment and that is no good for our cause...

Did you find a way to output to any kind of image based SLA printer like zip?

dStruct commented 4 years ago

I didn't dive into it too deeply, but I'll poke around and see if I can find any kind of SLA style post module, they have specifically Additive type slicing but most of what I saw was all FDM modules.

X3msnake commented 4 years ago

@dStruct as for the AA in Chitubox, you probably need to create a new default printer so it has access to all feautures and make sure you are using the latest version.

Anycubic S board type uses the same type of AA faking as Chitubox Cbddlp and .photon. it is a series of monochrome pictures slightly different. so the results are not that great and it is mostly just a bloated file.

AA s only good for shallow vertical wall too. so for most part youa re better off using monochrome

There are community tools to convert sl1 format to pws so you can slice directly from prusaslicer and covert the file too

dStruct commented 4 years ago

@X3msnake, so I did some digging around and the closest support I could find for something like this in the Autodesk ecosystem is to use MeshMixer and using Open Photon Slicer as a sort of plugin/module. Which brings up some questions, first given that the .photon format is now supported again, is Open Photon Slicer still a viable/compatible option to use with the “new” boards. And second question is more of a comment, but I think it would be extremely useful to be able to export the STL similar to how MeshMixer is doing it into Open Photon Slicer from within Fusion 360 as some kind of a Plugin/Addon, or possibly a Post Processor in the Machining tab. Having a GUI interface within Fusion 360 to setup the various OPS command-line options would be really great. I’ve never worked on a module/addon for Fusion 360 so I am not familiar with creating something like this, but I am happy to do some leg work if someone can point me in a starting direction.

X3msnake commented 4 years ago

should work with the new printers since .photon and .cbddlp is retro compatible.

as for what you are asking there is a dev branch of OPS that can be setup as a slicer dropfolder that automaticly slices any stl you drop in it

No dia terça-feira, 28 de abril de 2020, Matt notifications@github.com escreveu:

@X3msnake https://github.com/X3msnake, so I did some digging around and the closest support I could find for something like this in the Autodesk ecosystem is to use MeshMixer and using Open Photon Slicer as a sort of plugin/module. Which brings up some questions, first given that the .photon format is now supported again, is Open Photon Slicer still a viable/compatible option to use with the “new” boards. And second question is more of a comment, but I think it would be extremely useful to be able to export the STL similar to how MeshMixer is doing it into Open Photon Slicer from within Fusion 360 as some kind of a Plugin/Addon, or possibly a Post Processor in the Machining tab. Having a GUI interface within Fusion 360 to setup the various OPS command-line options would be really great. I’ve never worked with Fusion 360 an I am not familiar with creating something like this, but I am happy to do some leg work if someone can point me in a starting direction.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Photonsters/PhotonS/pull/1#issuecomment-620888101, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUR56VVOWCNFQJSZEF6P4LRO5J73ANCNFSM4ILPYFGQ .

-- Com os melhores cumprimentos, Vinicius Silva

jimberg98 commented 3 years ago

I whipped up a very basic C# app for reading the PWS file. It's pretty ugly, but can get you to the point of reading PWS files. It's a Windows Forms app that can walk through the slices. I did nothing with preview. I also wasn't sure how AA is supposed to work.

[Edit]

Anti-aliasing is done at the printer so the value just needs to be passed.

This is how you would convert the preview to a bitmap:

private void Load() { . . . _previewData = new byte[_preview.Width _preview.Height 2]; _stream.Read(_previewData, 0, _previewData.Length); Preview = new Bitmap(_preview.Width, _preview.Height, _preview.Width * 2, PixelFormat.Format16bppArgb1555, Marshal.UnsafeAddrOfPinnedArrayElement(_previewData, 0)); . . . }

The document on the format is incorrect in a couple places. It says that the preview image data is Length 2 bytes. It's actually Width Height * 2 bytes. I'm not sure about the pixel format, but what I have above does produce a recognizable image.

Have fun.

ReadPWS.zip

FireDeveloper commented 3 years ago

I whipped up a very basic C# app for reading the PWS file. It's pretty ugly, but can get you to the point of reading PWS files. It's a Windows Forms app that can walk through the slices. I did nothing with preview. I also wasn't sure how AA is supposed to work.

[Edit]

Anti-aliasing is done at the printer so the value just needs to be passed.

This is how you would convert the preview to a bitmap:

private void Load() { . . . _previewData = new byte[_preview.Width _preview.Height 2]; _stream.Read(_previewData, 0, _previewData.Length); Preview = new Bitmap(_preview.Width, _preview.Height, _preview.Width * 2, PixelFormat.Format16bppArgb1555, Marshal.UnsafeAddrOfPinnedArrayElement(_previewData, 0)); . . . }

The document on the format is incorrect in a couple places. It says that the preview image data is Length 2 bytes. It's actually Width Height * 2 bytes. I'm not sure about the pixel format, but what I have above does produce a recognizable image.

Have fun.

ReadPWS.zip

I was trying to do a similar software but without drawing graphics and I was getting an out of bounds exception when decompressing the pixels. It looks like with 4 AA levels it renders 4 times the picture. Chitubox export. I tried this line in your code and the same picture appears 4 times. var result = new Bitmap(_header.XResolution, _header.YResolution * 4); If you put a counter on var run you can see it draws x4 the pixel of the bitmap