[Sketcher] snapping discussion

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

Re: [Sketcher] snapping discussion

Post by adrianinsaval »

-alex- wrote: Tue Feb 07, 2023 12:36 pm BTW, in sketcher editing mode there is already a bit of confict between CAD nav. style +CTRL key (to pan) and RMB contextual menu.
IMHO a condition in the code is missing, something like:
If CTRL key enabled, then do not trigger sketcher RMB contextual menu.
That's weird and I think you should create an issue about this, I use gesture navigation style and panning with RMB (no other modifier required) works without issues, the context menu is not sown on release. I don't get why you don't pan with the middle button though.
CAD navigation style with CTRL and shift keys avoids carpal tunnel syndrom. It's a very ergonomic navigation style.
I don't quite get this, or why anyone would prefer this nav style for that matter :? to me it is an unnecessarily cumbersome style requiring two buttons in a specific sequence for rotation, no tilting available and you apparently use a modifier key variation for panning...
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Sketcher] snapping discussion

Post by openBrain »

-alex- wrote: Tue Feb 07, 2023 3:37 pm In the 2nd situation, when you release the RMB, instead of pan cursor you get the trigger of contextual sketcher menu.
Then it's tricky to get back to pan cursor.

Similar process if you want to tilt, but by holding Shift key. But you should notice there is no conflict in the tilt case, the contextual menu is not triggered. This how it should work.
There are lots of such issues across all navigation styles. I once find one and wanted to fix it. Then while debugging found another and another and... I'd like to tackle this, but this is full time job. :) Hopefully can have more spare time in a foreseeable future.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: [Sketcher] snapping discussion

Post by -alex- »

I'm going to try to explain, sorry if I'm too long and offtopic maybe.
adrianinsaval wrote: Tue Feb 07, 2023 3:52 pm That's weird and I think you should create an issue about this,
Maybe, BTW IIRC this issue occurred maybe 2 or 3 years ago. Not sure, I should check with FC 0.16 or 0.17.
I use gesture navigation style and panning with RMB (no other modifier required) works without issues, the context menu is not sown on release. I don't get why you don't pan with the middle button though.
Gesture style is quite good, no problem, very efficient. But not so ergonomic.
With CAD nav style I pan with the middle mouse wheel actually, but only in sketcher editing mode, in order to workaround the previously mentioned bug.
CAD navigation style with CTRL and shift keys avoids carpal tunnel syndrome. It's a very ergonomic navigation style.
I don't quite get this, or why anyone would prefer this nav style for that matter :? to me it is an unnecessarily cumbersome style requiring two buttons in a specific sequence for rotation, no tilting available and you apparently use a modifier key variation for panning...
Gesture navigation style requires you LMB or RMB click AND move the mouse, simultaneously.
That's not so good for tendons of the hand because you press with your finger permanently when moving precisely the mouse dynamically. Furthermore it push the mouse on the desk, it increase friction then it slides less easily.
That's why I prefer CAD navigation style, there is no combined efforts on the hand. You can hold CTRL statically with left hand fingers, while you just one click with right hand fingers then move the mouse, relax, during hours. That's ergonomic for right hand tendons, moreover it balance effort on both hands.
When you had modeled a lot since 20 years like me, your carpal tunnel teach all of this to your brain and that's crystal clear :|

PS: The drawback of CAD style, as you said, it requires two buttons in a specific sequence for rotation or pan. So both hand are busy and a bit of time is lost. But no pain, no gain ;)
Last edited by -alex- on Tue Feb 07, 2023 8:45 pm, edited 1 time in total.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: [Sketcher] snapping discussion

Post by -alex- »

openBrain wrote: Tue Feb 07, 2023 7:20 pm There are lots of such issues across all navigation styles. I once find one and wanted to fix it. Then while debugging found another and another and... I'd like to tackle this, but this is full time job. :) Hopefully can have more spare time in a foreseeable future.
I hope so :)
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Sketcher] snapping discussion

Post by adrianinsaval »

-alex- wrote: Tue Feb 07, 2023 8:37 pm Gesture navigation style requires you LMB or RMB click AND move the mouse, simultaneously.
That's not so good for tendons of the hand because you press with your finger permanently when moving precisely the mouse dynamically. Furthermore it push the mouse on the desk, it increase friction then it slides less easily.
That's why I prefer CAD navigation style, there is no combined efforts on the hand. You can hold CTRL statically with left hand fingers, while you just one click with right hand fingers then move the mouse, relax, during hours. That's ergonomic for right hand tendons, moreover it balance effort on both hands.
When you had modeled a lot since 20 years like me, your carpal tunnel teach all of this to your brain and that's crystal clear :|
ok it makes a lot more sense now, I never knew you could release the mouse click for this, it would be nice to implement this on other styles too. Is this only available when panning?
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: [Sketcher] snapping discussion

Post by -alex- »

adrianinsaval wrote: Tue Feb 07, 2023 8:46 pm I never knew you could release the mouse click for this
Yes, it's all about that :-)
Is this only available when panning?
Yes, the same. But buggy in sketcher editing mode as I said above.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] snapping discussion

Post by paddle »

Ok so it works as expected and it is mostly (see PR) done.

@abdullah I posted a draft PR so that you can see if the architecture match the expectations :
https://github.com/FreeCAD/FreeCAD/pull/8387

Regarding CTRL, its use does not interfer with the panning/rotating in my tests.

Thanks
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] snapping discussion

Post by paddle »

abdullah wrote: Tue Feb 07, 2023 1:51 pm Are you referring to snap to object, and the object is what you want as preselection?
Yes, to snap to object I use the preselected object to know on top of what the mouse is. You will see in more details in the PR.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: [Sketcher] snapping discussion

Post by -alex- »

paddle wrote: Tue Feb 07, 2023 8:56 pm Regarding CTRL, its use does not interfer with the panning/rotating in my tests.
OK.
JFYI:

Code: Select all

OS: Debian GNU/Linux 10 (buster) (LXDE/LXDE-pi)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31514 (Git)
Build type: Unknown
Branch: master
Hash: 620aaac90d259923d65324d68c3ceea9cd882970
Python 3.7.3, Qt 5.11.3, Coin 4.0.0a, Vtk 7.1.1, OCC 7.3.0
Locale: French/France (fr_FR)
With CAD navigation style enabled, below the sequence while holding ctrl key permanently: mouse cursor scrolling -> brief RMB click -> contextual sketcher menu triggered -> brief RMB again -> panning
CAD-nav-style_conflict2.gif
CAD-nav-style_conflict2.gif (109.54 KiB) Viewed 606 times

I stop here, want not hijack your topic.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Sketcher] snapping discussion

Post by openBrain »

paddle wrote: Tue Feb 07, 2023 8:56 pm Ok so it works as expected and it is mostly (see PR) done.

@abdullah I posted a draft PR so that you can see if the architecture match the expectations :
https://github.com/FreeCAD/FreeCAD/pull/8387

Regarding CTRL, its use does not interfer with the panning/rotating in my tests.

Thanks
First --because rest of the post may sound negative :)-- want to say I'm (really) glad you was able to get a grant for improving FreeCAD. ;)

Obviously it doesn't automatically bring with it a ticket for merging and good quality code is expected (as always).

Your PR doesn't even compile on the CI. This is kind of things I wish is checked before announcing it works.
Since I released the new CI, it has been allowed to run on fork repos, so I'm encouraging you to update the master branch of your fork so CI will run on every push to your repo and you'll get the result (first run will be quite long, time to create cache).

Also please take care of your commits. Things are more easily reviewed and merged if they come as a sequence of well thought commits that each introduces a limited but consistent set of things. Your PR may well be 3 to 4 commits. You may read a bit of documentation about 'git commit --fixup' and 'git rebase --autosquash' so you can envisage it in a sustainable way.
Post Reply