Zoom Actual PR (poll)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!

Did you try the macro and did it work as expected?

Poll ended at Sat Oct 30, 2021 7:24 pm

Yes, works as expected here.
3
50%
Yes, but it doesn't work here.
1
17%
No, don't want / not interested in this feature.
1
17%
What's a macro?
1
17%
 
Total votes: 6
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Zoom Actual PR (poll)

Post by TheMarkster »

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.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Zoom Actual PR (poll)

Post by wmayer »

TheMarkster wrote: Thu Oct 28, 2021 5:04 pm This sort of scaling might not even make sense for this camera mode.
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.
If that's the case, then the thing to do would be to check in isActive() and return False unless in ortho 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.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Zoom Actual PR (poll)

Post by TheMarkster »

wmayer wrote: Thu Oct 28, 2021 7:32 pm 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.
Yes, this is better. I'll add it to the PR.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Zoom Actual PR (poll)

Post by adrianinsaval »

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
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Zoom Actual PR (poll)

Post by wmayer »

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?
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Zoom Actual PR (poll)

Post by Chris_G »

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 :

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)
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Zoom Actual PR (poll)

Post by adrianinsaval »

That's some weird behaviour by Qt, physicaldpi is meant to be independent of scaling factors precisely
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Zoom Actual PR (poll)

Post by wmayer »

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()
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Zoom Actual PR (poll)

Post by openBrain »

Would using logicalDpiX instead of physicalDpiX help?
Can't test right now by myself. :)
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Zoom Actual PR (poll)

Post by user1234 »

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
Post Reply