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 screenshots in show #1759

Merged
merged 10 commits into from
Feb 9, 2025
Merged

Implement screenshots in show #1759

merged 10 commits into from
Feb 9, 2025

Conversation

adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Feb 2, 2025

I had to implement something quickly for my slides, I think it'll be quite useful for others.

  • png screenshot
  • tune camera position, zoom, bg, wxh, ...
  • tender off-screen when non-interactive
  • test

img

Note that offscreen rendering does not work in CI with the exception of mac - that's why the test is dummy.

@adam-urbanczyk adam-urbanczyk marked this pull request as draft February 2, 2025 16:23
@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review February 2, 2025 18:05
@jmwright
Copy link
Member

jmwright commented Feb 2, 2025

Is it normal to get a different view in the PNG than I see in the window?

Window

Screenshot from 2025-02-02 13-35-10

Output PNG

screenshot

Copy link

codecov bot commented Feb 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.62%. Comparing base (f13f607) to head (a1c4e59).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1759      +/-   ##
==========================================
+ Coverage   95.33%   95.62%   +0.28%     
==========================================
  Files          28       28              
  Lines        6841     8137    +1296     
  Branches     1025     1305     +280     
==========================================
+ Hits         6522     7781    +1259     
- Misses        194      222      +28     
- Partials      125      134       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adam-urbanczyk
Copy link
Member Author

I don't think so. I don't see such issues.

@jmwright
Copy link
Member

jmwright commented Feb 2, 2025

I don't know if it makes a difference, but I'm on Debian 12 x84_64.

@adam-urbanczyk
Copy link
Member Author

Would you be able to provide a MRE? If there is nothing obvious, I'd still propose to merge this and add a note in the docs.

@adam-urbanczyk
Copy link
Member Author

On win I use

show(box(1,1,1), screenshot='img.png', interact=False, width=400, height=400, gradient=False, trihedron=False)

and that results in:
img

this is what I get in the window
image

@jmwright
Copy link
Member

jmwright commented Feb 3, 2025

I wonder if there is a timing aspect to it. I cannot reproduce the issue that I had yesterday.

@adam-urbanczyk
Copy link
Member Author

Interesting, did you use interact=False or True?

@jmwright
Copy link
Member

jmwright commented Feb 3, 2025

I believe I tried it both ways, but I know I started with interact=True. I ran python from the terminal and entered the commands manually that way yesterday. I have tried it both that way and via a script this morning and cannot reproduce.

@adam-urbanczyk
Copy link
Member Author

adam-urbanczyk commented Feb 3, 2025

OK, unless you are able to reproduce it, I propose to park it. I will add a note to the docs anyhow.

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc/vis.rst Outdated Show resolved Hide resolved
Copy link
Member

@lorenzncode lorenzncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adam-urbanczyk , screenshots also working for me.

@adam-urbanczyk adam-urbanczyk merged commit 7cade87 into master Feb 9, 2025
6 checks passed
@adam-urbanczyk adam-urbanczyk mentioned this pull request Feb 10, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants