Announce first iteration of NaviCube for FreeCAD

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Announce first iteration of NaviCube for FreeCAD

Postby nyholku » Sat Feb 18, 2017 6:53 pm

Hi,

I've just pushed my first attempt at creating a "Navigation Cube" for FreeCAD.

You can get it from my Github repo from the "navicube" branch:

https://github.com/nyholku/FreeCAD/tree/navicube

Here is comparison against master:

https://github.com/FreeCAD/FreeCAD/comp ... u:navicube

Lots of cleanup to do and there I things I could use help with ... or perhaps the whole approach is unpalatable.

All feedback welcome.

wbr Kusti
User avatar
Kunda1
Posts: 5529
Joined: Thu Jan 05, 2017 9:03 pm

Re: Announce first iteration of NaviCube for FreeCAD

Postby Kunda1 » Sat Feb 18, 2017 7:01 pm

What is NaviCube?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
saso
Posts: 1313
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Announce first iteration of NaviCube for FreeCAD

Postby saso » Sat Feb 18, 2017 7:30 pm

nyholku wrote: I've just pushed my first attempt at creating a "Navigation Cube" for FreeCAD.
super exited to see this! maybe some screenshot? :) can you also add the 12 views (FRONT_LEFT, LEFT_REAR, REAR_RIGHT,...) that are shown at the top of this two icon sets https://forum.freecadweb.org/viewtopic. ... 484#p84623 (i am not the best when reading code, so sorry if they are already implemented :oops: )
Kunda1 wrote:What is NaviCube?
see the next post after the one linked in the above link
Last edited by saso on Sat Feb 18, 2017 8:17 pm, edited 1 time in total.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Announce first iteration of NaviCube for FreeCAD

Postby nyholku » Sat Feb 18, 2017 7:47 pm

Her you go:

Image
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: Announce first iteration of NaviCube for FreeCAD

Postby cox » Sat Feb 18, 2017 7:50 pm

Wow, this looks nice :D
Need help? Feel free to ask, but please read the guidelines first
ickby
Posts: 2918
Joined: Wed Oct 05, 2011 7:36 am

Re: Announce first iteration of NaviCube for FreeCAD

Postby ickby » Sat Feb 18, 2017 9:57 pm

Hello,

I tested your work, compiles fine for me on ubuntu. I really like the cube, very good work! Code wise I think your implementation is fine. I have no clue about openGL code, so can't comment on that, but the general idea to render the cube above the scene is just fine! Do you want some testing and bug reporting or is this too soon? If you have any questions on technical point of view just ask!

here a few observations:

1. The cube is always in perspective projection, even if the user has orthographic on in the main view. that is a bit confusing.
2. The animations are a bit laggy. I noticed that you don't use the python commands like the view toolbar. Maybe it would be wise to do that, as this would fit the freecad philosophy well (as it is recordable) and would give you all the implementation for free.
3. I find the buttons a bit hard to hit, the sensitive area is too small for me. I don't know if that is just for me cause I have a high resolution screen or if they are too small in general. I think it would help to make the sensitive area a bit larger than the actual button in any case, IMHO this would increase the user experiance as the fast click would succeed more often
4. Size of the cube should somehow be adjustable, as I could imagine that for some people the control is too small. (also resolution dependend the size may need to change)
5. The text is not translated
6. The cube works nice with a white background, but when using a dark one it gets somewhat confusing. Due to the shining-through stripes in the cube getting very dominant for dark background I sometimes lost the orientation in the cube and did not recognize anymore its square form.
7. the corner areas are a bit ahrd to see. maybe some more dominant borders on the sensitive areas could improve the seperation between the individual areas?
8. The axis labels like x,z are rendered below the button. imho it should be the other way around, as right now the labels can be hidden and that is a bit annoying.
9. The axiometric view of the view menu is different than your cube corner buttons, how comes that?


thanks for your work!
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Announce first iteration of NaviCube for FreeCAD

Postby triplus » Sat Feb 18, 2017 10:00 pm

Cube.png
Cube.png (8.01 KiB) Viewed 1621 times
Looking good.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Announce first iteration of NaviCube for FreeCAD

Postby nyholku » Sat Feb 18, 2017 10:04 pm

Hi Ickby,

thanks for the thoughtful comments.

As a general note this is just the beginning of making this into a usable feature...felt I needed to show it before I spend too much time on it.

Agree with your comments almost 100% but now it is past midnight here so I will have to leave commenting until tomorrow.


good night, Kusti
User avatar
DeepSOIC
Posts: 6969
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Announce first iteration of NaviCube for FreeCAD

Postby DeepSOIC » Sun Feb 19, 2017 12:58 am

When I visited OnShape, and saw the cube, I immediately liked it very much. Thank you for bringing it into FreeCAD.
nyholku
Posts: 149
Joined: Wed Dec 28, 2016 4:18 pm

Re: Announce first iteration of NaviCube for FreeCAD

Postby nyholku » Sun Feb 19, 2017 5:16 am

1. The cube is always in perspective projection, even if the user
has orthographic on in the main view. that is a bit confusing.
Admitted and originally I had not plan to have any perspective but I
kind of fell for it and like it even in ortho mode. Easy to change of
course and it could be an option.

2. The animations are a bit laggy. I noticed that you don't use
the python commands like the view toolbar. Maybe it would be wise
to do that, as this would fit the freecad philosophy well (as it is recordable)
and would give you all the implementation for free.
I have no idea why the animation is what it is. I took my cue from the
standard left/right etc view buttons work so I was hoping that would do it correctly.

As to why I did not use the python commands was that I could not find
python commands for the "left_rear","top_right_front" etc commands
so I thought that for the shake of consistency in the code and wanting
to keep my intrusion to the whole code base minimal I chose to do it
all by my self.

If the python commands are available I would like to change this
of course.


3. I find the buttons a bit hard to hit, the sensitive area is too small for me.
I don't know if that is just for me cause I have a high resolution screen or if they
are too small in general. I think it would help to make the sensitive area
a bit larger than the actual button in any case, IMHO this would increase the user
experiance as the fast click would succeed more often
Agreed. However this is mostly due to the way the hit testing is implemented
and a small detail there that I've not been able to fix.

Hit testing is done by drawing the cube face to an offscreen buffer, each
face with different color and then reading back the pixel under the cursor.

The problem is that the off screen drawing is done with antialiasing on
so the edges of each face are not of the correct color and thus I need
to reject them which makes them smaller especially the corners.

I some one could tell how to turn off antialiasing in OpenGL so that it
actually happens (or actually not!) I would be grateful.

If you uncomment this line (about line 930) in the code:

Code: Select all

		//image.save(QLatin1String("pickimage.png"));
You can have a look at the offscreen image and the problem. The 'colors'
used to draw the cube for picking are very small numerical values in
red channel so you will have to turn on the contrast a lot to see them.

4. Size of the cube should somehow be adjustable, as I could
imagine that for some people the control is too small.
(also resolution dependend the size may need to change)
Agreed. I will add something so that the size can be changed.
5. The text is not translated
Agreed, they should be.

Incidentally I went with 'Rear' instead of 'Back'
for the sake of consistency though I would have preferred 'Back'.

I tried to find some support for 'back' but it seems that both words are
more or less used interchangeably. My daughter who is studying English
and knows more about it than most native speakers could not find
any real difference and just said that 'Rear' is more posh way of saying
it and 'back' is what people would use when speaking cause it is
easier to pronounce.



6. The cube works nice with a white background, but when using a
dark one it gets somewhat confusing. Due to the shining-through
stripes in the cube getting very dominant for dark background I
sometimes lost the orientation in the cube and did not recognize
anymore its square form.
Agreed it works best on ligth or actually white background (which I
prefer. I'm not sure the transparency effect can be made to work on
dark background so maybe that should be optional (took me moths
in Onshape to even notice that effect so I don't think it is essential).

7. the corner areas are a bit ahrd to see. maybe some more dominant
borders on the sensitive areas could improve the seperation between
the individual areas?
They are a bit hard to see and I've experimented with that but never
found a way to make them better. In Onshape they somehow are
a bit easier to see IMO but I can't put my finger on it. OTH again
it took me months to notice them in Onshape and I never used
them so...
8. The axis labels like x,z are rendered below the button.
imho it should be the other way around, as right now the labels can
be hidden and that is a bit annoying.
Agreed, this needs fixing and some other tweaking too.
9. The axiometric view of the view menu is different than your cube
corner buttons, how comes that?
So you mean it should look more like the navigation cube itself?

Well, why not, but then I think I would need to make it with SVG
which would mean I will have to find an SVG editor and learn to
use it, this icon was hacked together with OpenGL in a few minutes.

We can change this but I'm pretty sure that for me it will take
some hours to produce an SVG icon plus a matching 'mask' icon
for the offscreen pick thing and add them as resources. So I was
thinking that won't put too much effort into details before
I know this has a chance to make it to the FreeCAD master
branch.

Also maybe if there is an icon overhaul in the process it would
make sense to have this icon designed by some proper designer
to match the style.