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

Projector fails displaying layer #1140

Closed
uli99 opened this issue Jan 2, 2021 · 7 comments · Fixed by #1148
Closed

Projector fails displaying layer #1140

uli99 opened this issue Jan 2, 2021 · 7 comments · Fixed by #1148

Comments

@uli99
Copy link

uli99 commented Jan 2, 2021

Hi,

OS: Linux Mint 20 Cinnamon
Pronterface 2.0.0rc7

Just tried to use Pronterfaces Projector tool to display/ project a SVG slice created with Slic3r (Slice to SVG). The file displays fine with:
http://garyhodgson.github.io/slic3rsvgviewer/

I clicked on Controls-->Load and loaded the SVG-Slice-File with no error and displays correct infos in the Info section:
File: gear_for_wormgear_lychee.svg
Total Layers: 833
Current Layer: 0
Estimated Time: 01:09:25

But when I click on the "Present" button or try to select the "1st Layer" checkbox I get the error message below:

Layer thickness detected: 2.999999999999802e-08 mm
833 layers found, total height 2.498999999999835e-05 mm
/home/uli/Documents/3D-Printer_LCD/Printrun/printrun/projectlayer.py:121: wxPyDeprecationWarning: Call to deprecated item BitmapFromImage. Use :class:wx.Bitmap instead
dc.DrawBitmap(wx.BitmapFromImage(image.Scale(image.Width * self.scale, image.Height * self.scale)), self.offset[0], -self.offset[1], True)
Traceback (most recent call last):
File "/home/uli/Documents/3D-Printer_LCD/Printrun/printrun/projectlayer.py", line 614, in show_first_layer
self.present_first_layer(event)
File "/home/uli/Documents/3D-Printer_LCD/Printrun/printrun/projectlayer.py", line 676, in present_first_layer
self.display_frame.draw_layer(copy.deepcopy(self.layers[0][0]))
File "/home/uli/Documents/3D-Printer_LCD/Printrun/printrun/projectlayer.py", line 105, in draw_layer
stream = io.StringIO(PNGSurface.convert(dpi = self.dpi, bytestring = xml.etree.ElementTree.tostring(image)))
TypeError: initial_value must be str or None, not bytes

I'm a first time user of Pronterface so it might be a stupid mistake on my side...

Uli

@volconst
Copy link
Collaborator

volconst commented Jan 2, 2021

Are you starting pronterface with python3?
Pass only the -V switch to the interpreter you are using.
Not sure if projector code is working.

@uli99
Copy link
Author

uli99 commented Jan 2, 2021

I started it with
Python 2.7.18
I just tried
Python 3.8.5
but with the same outcome.

I think the problem is that projectlayer.py tries to load the slic3r SVG's namespace from
http://slic3r.org/namespaces/slic3r
in line 501and fails to do so because the url is no longer valid (page not found).

I tried to find a working url but couldn't find anything usful (yet).

volconst added a commit to volconst/Printrun that referenced this issue Jan 8, 2021
Rendering did not work, probably since python3.
Default first layer timeout of -1 was ignored
@volconst
Copy link
Collaborator

volconst commented Jan 8, 2021

@uli99 You can checkout this branch https://github.com/volconst/Printrun/tree/projector-api-sync and test the fix.
The branch fixes the exception, tooltips and layout, but I have no idea whether you can actually print an object with Projector.

@uli99
Copy link
Author

uli99 commented Jan 8, 2021

Seems to work (despite the not working namspace url, not sure why?). Maybe I don't understand the code that well...
I had to replace time.clock() with time.time() to get it to run.

Thanks!

@volconst
Copy link
Collaborator

volconst commented Jan 8, 2021

I think namespaces are URIs, not URLs. Just names, not an existing resource that is retrieved.
Can you print an object now?

@uli99
Copy link
Author

uli99 commented Jan 10, 2021

Still have to modify the script for my displays resolution (2K display with 2560x1600px) and use a Raspberry 4 with two displays to test...

@volconst
Copy link
Collaborator

Does'nt a usable projector host software come with your printer?
Aren't "X", "Y", or "Fullscreen" dialog controls enough to adapt to different screen sizes?
Do you find the log using time()/clock() useful? I do not know what it's purpose is, probably to track whether rendering load messes up slide timing, but you have to subtract the times yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants