Zoom Actual PR (poll)
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Zoom Actual PR (poll)
wmayer has also found another issue when the camera is not orthogonal, but perspective, where the height attribute is unavailable. Perspective might not even have been an option at the time the macro was written.
Edit: It does have a scaleHeight() function, but with just a bit of expermentation it appears only to scale whatever the current camera height happens to be. For example, scaleHeight(1) does nothing, but scaleHeight(2) would zoom out. I haven't used this camera mode much because I never liked it. This sort of scaling might not even make sense for this camera mode. If that's the case, then the thing to do would be to check in isActive() and return False unless in ortho mode.
Edit: It does have a scaleHeight() function, but with just a bit of expermentation it appears only to scale whatever the current camera height happens to be. For example, scaleHeight(1) does nothing, but scaleHeight(2) would zoom out. I haven't used this camera mode much because I never liked it. This sort of scaling might not even make sense for this camera mode. If that's the case, then the thing to do would be to check in isActive() and return False unless in ortho mode.
Re: Zoom Actual PR (poll)
No it doesn't because perspective projections don't keep dimensions. If you rotate the above mentioned cube then you can see that the edge lengths will change without changing the height angle of the camera.TheMarkster wrote: ↑Thu Oct 28, 2021 5:04 pm This sort of scaling might not even make sense for this camera mode.
Either this or you pop up a dialog in the activated() method that the function cannot be used for non-orthographic cameras. I prefer the latter because ofr many users it isn't very obvious what needs to be done to make the command to become active.If that's the case, then the thing to do would be to check in isActive() and return False unless in ortho mode.
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: Zoom Actual PR (poll)
Yes, this is better. I'll add it to the PR.
- adrianinsaval
- Veteran
- Posts: 5541
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Zoom Actual PR (poll)
maybe a warning in the report view is better than a popup as it's less invasive but I think it would still catch the attention of most
Re: Zoom Actual PR (poll)
I am not a fan of showing such messages (only) in the report view. Instead of popping up a modal dialog an alternative could be to tmp. show a message in the 3d view. In FreeCAD we have the class StatusWidget for this kind of purposes that can be combined with a timer and shown for a few seconds.
But I still wonder in which cases the function apparently doesn't work and when this tweak factor is needed. Could this be related to HiDPI monitors?
But I still wonder in which cases the function apparently doesn't work and when this tweak factor is needed. Could this be related to HiDPI monitors?
Re: Zoom Actual PR (poll)
I just compiled and tested.
I have a ASUS MG28U 4K monitor.
The result of the "Zoom Actual" command depends on my Plasma desktop "Global Scaling" factor.
For a 100mm cube, here are my results :
- Global Scaling = 100x, cube measure = 100mm ... Working
- Global Scaling = 150x, cube measure = 66mm ... Fail
- Global Scaling = 200x, cube measure = 50mm ... Fail
And my FC info :
I have a ASUS MG28U 4K monitor.
The result of the "Zoom Actual" command depends on my Plasma desktop "Global Scaling" factor.
For a 100mm cube, here are my results :
- Global Scaling = 100x, cube measure = 100mm ... Working
- Global Scaling = 150x, cube measure = 66mm ... Fail
- Global Scaling = 200x, cube measure = 50mm ... Fail
And my FC info :
Code: Select all
OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.26244 +4 (Git)
Build type: Release
Branch: zoom
Hash: 26f2eabd4a5e9c69d29957dca434a34bd8852332
Python version: 3.9.7
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: French/France (fr_FR)
- adrianinsaval
- Veteran
- Posts: 5541
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Zoom Actual PR (poll)
That's some weird behaviour by Qt, physicaldpi is meant to be independent of scaling factors precisely
Re: Zoom Actual PR (poll)
On a normal monitor it's possible to test a few HiDPI things by setting QT_SCALE_FACTOR. When I set it to 2.0 and run the macro the object is clearly too small -- by the same factor.
So, obviously HiDPI matters and must be respected to get the correct scaling. For this we have the method QWidget::devicePixelRatioF()
So, obviously HiDPI matters and must be respected to get the correct scaling. For this we have the method QWidget::devicePixelRatioF()
Re: Zoom Actual PR (poll)
Would using logicalDpiX instead of physicalDpiX help?
Can't test right now by myself.
Can't test right now by myself.
Re: Zoom Actual PR (poll)
It works here on Debian with a 4K Monitor. But i do not like the feature, because it is too fault-prone an can ruin to monitor. I think this is maybe the main reason, why other CADs do have that function. But i am not strictly against it, if someone want to ruin the monitor.
Greetings
user1234
Greetings
user1234