ezrec / uv3dp

Tools for UV Resin based 3D Printers (in Go)
MIT License
58 stars 14 forks source link

Converting .photon files always fails with panic: Layer 0: Z value of 0.00mm is too close to the screen #144

Open Jochen-Scharr opened 3 years ago

Jochen-Scharr commented 3 years ago

Hi,

first of all: Great work! Thanks a lot for it! It could help me very much - if it worked for .photon files (having a Photon printer myself).

The issue is: No matter what .photon file I try to convert, no matter what file version (1 or 2) it always produces the mentioned error.

This is because in photon files the first layer always starts at z = 0 (and the layer thickness is added). I also found that a strange way of counting (I was developing routines in C# for reading/writing photon files myself). IMO that shouldn't be too hard to fix.

My test files (see attachments) all were sliced using Anycubic Photon Workshop (or, for file version1 its predecessor).

PhotonTestFiles.zip

I'd appreciate it a lot if you could fix that quickly.

Many thanks

Jochen

sn4k3 commented 3 years ago

If you good with C# you can use UVtools.Core which you can get directly from nuget or VS package manager. About that Z0 if you open those files in UVtools, they will be auto fixed and offset all Z's by layer height, just need to open and close the file there - simple as that.

About uv3dp, it makes that check and then halts. Maybe it would be good to auto fix the file like UVtools, by offset all layers by layer height if layer0.Z == 0

Here my sanitizer:

https://github.com/sn4k3/UVtools/blob/d104dc84f28a4709332a81700ff3a4058ebb946b/UVtools.Core/Layer/LayerManager.cs#L430

Jochen-Scharr commented 3 years ago

@sn4k3: Thanks for the hint. I've seen UVtools, it seems to be great and exactly what I need, but unfortunately I cannot use it because of its license (cannot make my project AGPL, too).

The auto-fix you propose is a good idea and if I already had the right setup and a little GO experience, I'd implement it myself in uv3dp. But that's very big effort for just a little change like that... So I hope that the makers of uv3dp will quickly fix it. Btw.: When writing back a photon file, one shouldn't forget to do the inverse.

sn4k3 commented 3 years ago

If your project is for yourself and without intention to distribute/share/put online you can use AGPL dependencies without the need of publish your work.

I'd implement it myself in uv3dp

You can give it a try, it should be about 4 lines, not a lot of effort