NaviCube: improved style

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

User avatar
easyw-fc
Posts: 2689
Joined: Thu Jul 09, 2015 9:34 am

Re: NaviCube: improved style

Post by easyw-fc » Mon Apr 15, 2019 8:47 am

we could use a short version for labels:
TOP
BTM
FRNT
REAR
LFT
RX
SX
Still there is a need to add an uniform letter-spacing.
top.png
top.png (3.35 KiB) Viewed 718 times

wmayer
Site Admin
Posts: 14989
Joined: Thu Feb 19, 2009 10:32 am

Re: NaviCube: improved style

Post by wmayer » Mon Apr 15, 2019 9:01 am

The culprit of the bad look is this line:

Code: Select all

sansFont.setStretch(QFont::ExtraCondensed);
When commenting it out the text looks much better.

tyszja
Posts: 17
Joined: Tue Apr 09, 2019 1:24 pm

Re: NaviCube: improved style

Post by tyszja » Sun Apr 21, 2019 6:57 pm

wmayer wrote:
Mon Apr 15, 2019 9:01 am
The culprit of the bad look is this line:

Code: Select all

sansFont.setStretch(QFont::ExtraCondensed);
When commenting it out the text looks much better.
@wmayer: Thanks for your finding. Interesting... maybe its some kind of bug in Qt for Windows? Does the bottom layer label still fit within the face boundaries when it's commented out?

With this offending line I could squeeze in a larger font on a face while making the cube smaller and still keep the same readability level. But with this being broken on Windows we shouldn't merge this PR for sure! Thanks again for verifying this.
I might try the Windows build next time before making a pull request, but I don't have the toolchain set up on Windows yet. I won't be able to verify the macOS build though - not a mac owner.

[EDIT]
Since the PR was already merged, I did a fix on top of the current master branch to mitigate the character spacing error on Windows. Font size is now soft-constrained - has an upper limit to not overflow Cube's face. It's applied individually on each face only if it overflows due to the font size being to big. Currently it only makes the bottom face use slightly smaller font, while other faces are consistent in using slightly larger one - seems like a good compromise to me.
It's this branch: https://github.com/tyszja/FreeCAD/tree/naviCube_improve. But I still have to build it against Windows to verify.

BTW: I've did some work to make the Cube configurable, but it's still to early to post anything.
Last edited by tyszja on Mon Apr 22, 2019 11:05 am, edited 1 time in total.

alberich
Posts: 48
Joined: Thu Aug 17, 2017 2:09 pm
Location: Texas

Re: NaviCube: improved style

Post by alberich » Mon Apr 22, 2019 10:55 am

Cube could use one-letter labels with some renaming. One possibility is
  • D dexter (Right)
    S sinister (Left)
    B bottom
    T top
    R rear
    F front
The dexter/sinister thing may be too obscure so maybe change Bottom to Underside, Rear to Back, giving
  • R right
    L left
    U underside
    T top
    B back
    F front

wmayer
Site Admin
Posts: 14989
Joined: Thu Feb 19, 2009 10:32 am

Re: NaviCube: improved style

Post by wmayer » Mon Apr 22, 2019 10:56 am

Thanks for your finding. Interesting... maybe its some kind of bug in Qt for Windows?
Possible. At least with Qt4.8 it looks good and there is no change required. With Qt5.6 or Qt5.12 the change is required.
Does the bottom layer label still fit within the face boundaries when it's commented out?
It's clearly outside of the cube's face. The letters "B" and "m" lie on the rounded edges of the cube.

I guess this has something to do that in Qt5.x the whole OpenGL support has been reworked. I remember that in the old QGLWidget class there was a method to paint text and with the workarounds for Qt5 the text looks really ugly.

For the Image module I once found a nice solution based on QPainterPath and the rendered text looks nice. See GLImageBox::renderText. Maybe the same idea (at least for Qt5 on Windows) could be applied on the NaviCube.
With this offending line I could squeeze in a larger font on a face while making the cube smaller and still keep the same readability level. But with this being broken on Windows we shouldn't merge this PR for sure! Thanks again for verifying this.
I might try the Windows build next time before making a pull request, but I don't have the toolchain set up on Windows yet. I won't be able to verify the macOS build though - not a mac owner.
I once had the situation that text painted on a GL canvas was truncated and after upgrading the graphic driver the issue was gone. So, it's possible that on your system it might look good but then on another computer it doesn't.

tyszja
Posts: 17
Joined: Tue Apr 09, 2019 1:24 pm

Re: NaviCube: improved style

Post by tyszja » Mon Apr 22, 2019 11:14 am

wmayer wrote:
Mon Apr 22, 2019 10:56 am
Thanks for your finding. Interesting... maybe its some kind of bug in Qt for Windows?
Possible. At least with Qt4.8 it looks good and there is no change required. With Qt5.6 or Qt5.12 the change is required.
Does the bottom layer label still fit within the face boundaries when it's commented out?
It's clearly outside of the cube's face. The letters "B" and "m" lie on the rounded edges of the cube.

I guess this has something to do that in Qt5.x the whole OpenGL support has been reworked. I remember that in the old QGLWidget class there was a method to paint text and with the workarounds for Qt5 the text looks really ugly.

For the Image module I once found a nice solution based on QPainterPath and the rendered text looks nice. See GLImageBox::renderText. Maybe the same idea (at least for Qt5 on Windows) could be applied on the NaviCube.
With this offending line I could squeeze in a larger font on a face while making the cube smaller and still keep the same readability level. But with this being broken on Windows we shouldn't merge this PR for sure! Thanks again for verifying this.
I might try the Windows build next time before making a pull request, but I don't have the toolchain set up on Windows yet. I won't be able to verify the macOS build though - not a mac owner.
I once had the situation that text painted on a GL canvas was truncated and after upgrading the graphic driver the issue was gone. So, it's possible that on your system it might look good but then on another computer it doesn't.
Thanks. I'll see once I have all the build tools and libs set up on Windows. In the mean time I did a quick fix here: https://github.com/tyszja/FreeCAD/tree/naviCube_improve It removes the Condensed parameter and applies an upper size limit to a label only when it's to large to fit... this should now only affect the bottom face. As a result the bottom face should now use a slightly smaller font size than all the other use - it slightly breaks the consistency on this single face but shouldn't hurt your eyes too much. ;)

tyszja
Posts: 17
Joined: Tue Apr 09, 2019 1:24 pm

Re: NaviCube: improved style

Post by tyszja » Sun Apr 28, 2019 6:44 am

Hi,

If anyone cares, my NaviCube related branch has been updated with the configurable opacity, scale and position lock preferences (and hopefully fixed the unreadable text on Windows+Qt5).
The bad news is that I've probably messed up some translations as I couldn't just simply throw another few option widgets into this already mixed bag of options in the '3D View' section - so I did some spring cleaning there (It's a separate commit though thus can be skipped If anyone cares to pull without the cleanup).

Oh, the branch is here: https://github.com/tyszja/FreeCAD/tree/naviCube_improve

New and old look comparison attached. Left is the new one. ;)
Attachments
Zrzut ekranu z 2019-04-28 08-27-44.png
preferences comparison
Zrzut ekranu z 2019-04-28 08-27-44.png (336.47 KiB) Viewed 514 times

wmayer
Site Admin
Posts: 14989
Joined: Thu Feb 19, 2009 10:32 am

Re: NaviCube: improved style

Post by wmayer » Sun Apr 28, 2019 7:52 am

New and old look comparison attached. Left is the new one
Please put all NaviCube settings into its own tab. The current 3D view page is already a bit overloaded and there shouldn't be added more widgets. Keep in mind that there are users with relative small displays and when a page has too many controls then it affects usability (if things work correctly then a scrollbar is shown, if not then the page is truncated).

tyszja
Posts: 17
Joined: Tue Apr 09, 2019 1:24 pm

Re: NaviCube: improved style

Post by tyszja » Sun Apr 28, 2019 8:39 am

wmayer wrote:
Sun Apr 28, 2019 7:52 am
Keep in mind that there are users with relative small displays and when a page has too many controls then it affects usability (if things work correctly then a scrollbar is shown, if not then the page is truncated).
Right... When I looked at the current state of the 3D View tab with all these widgets mixed up with no sense I thought that no one thinks about the usability. Good I was wrong. I got your point, thanks.

reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: NaviCube: improved style

Post by reox » Mon Apr 29, 2019 5:03 pm

easyw-fc wrote:
Mon Apr 15, 2019 8:47 am
TOP
BTM
FRNT
REAR
LFT
RX
SX
seven labels for six faces? :mrgreen:

Why not use N, E, S, W, T, B?

Code: Select all

    #                    North
    #
    #                +-----------+
    #               /           /|
    #              /  Top      / |
    #             /           /  |
    #            /           /   |
    #           +-----------+    |
    #           |           |    +
    #           |           |   /    East
    #   West    |   South   |  /
    #           |           | /
    #           |           |/
    #           +-----------+
    #   z
    #   ^          Bottom
    #   |   y
    #   | /
    #   |/
    #   +------> x
Or is the usage of cardinal directions not common in CAD? From what I'm used to, it is used in FEM to describe the faces of an hexahedron.

Post Reply