Better selection system for constraints in Sketcher

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

Moderator: agryson

jnxd
Posts: 127
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Fri Feb 10, 2017 6:00 pm

wwmeyer, on Github PR #502

There is an oddity with the symmetry command:

  • symmetry between two point and a line the selection order must be point, line, point. Point, point, line doesn't work but with the old mode it does
  • symmetry between three points it uses the second point as symmetry point but the old mode uses the last point


Indeed, that was my intention. I followed it from Abaqus (sorry about that, hopefully will get used to "saner" defaults with time). It should be easy enough to change it to what you seem to desire, but shall we wait a while for the rest of the community's inputs?
wmayer
Site Admin
Posts: 11331
Joined: Thu Feb 19, 2009 10:32 am

Re: Better selection system for constraints in Sketcher

Postby wmayer » Fri Feb 10, 2017 6:50 pm

All what I want to say is that how it works at the moment is inconsistent. But if you have a reference application (Abaqus) that does it as the new mode then it's also fine for me to adjust the old mode to be compatible to the new mode.
jnxd
Posts: 127
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Fri Feb 10, 2017 7:07 pm

wmayer wrote:All what I want to say is that how it works at the moment is inconsistent. But if you have a reference application (Abaqus) that does it as the new mode then it's also fine for me to adjust the old mode to be compatible to the new mode.

But changing that would lead to angry freecad users :lol:
jnxd
Posts: 127
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Fri Feb 10, 2017 7:30 pm

If you do decide to change the old mode, we might have to slightly modify the code for the new mode also. But that's for future to resolve.

Are you fine with the rest of the constraints? There's no way to use the single point variant of hori. and vert. distance constraints with a single point, since the way I designed it all, the patterns have to be prefix free.
DeepSOIC
Posts: 4662
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Better selection system for constraints in Sketcher

Postby DeepSOIC » Fri Feb 10, 2017 7:32 pm

jnxd wrote:But changing that would lead to angry freecad users :lol:
If you want to change symmetry constraint selection order to point-mirror-point instead of current point-point-mirror, I won't complain. The new order makes for a more geometrically straight selection order, which will improve how fast one can select the stuff.
User avatar
bejant
Posts: 4125
Joined: Thu Jul 11, 2013 3:06 pm

Re: Better selection system for constraints in Sketcher

Postby bejant » Fri Feb 10, 2017 10:15 pm

jnxd wrote:There's no way to use the single point variant of hori. and vert. distance constraints with a single point,

I'm not sure that's a good trade-off, is it possible to reinstate it somehow? It's very convenient to be able to select a point / endpoint / vertex and apply a Vertical or Horizontal Distance Constraint to the origin, without ever having to select the origin first. Even more so when a Sketch has symmetry about the X, Y, or Z axis.

Additionally, when the user is zoomed in and the origin isn't visible, in order to select the origin as the second pick this also means that now the user has to zoom out first.
My Part Design tutorials on YouTube (aimed at beginners).
jnxd
Posts: 127
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Sat Feb 11, 2017 2:17 am

bejant wrote:
jnxd wrote:There's no way to use the single point variant of hori. and vert. distance constraints with a single point,

I'm not sure that's a good trade-off, is it possible to reinstate it somehow? It's very convenient to be able to select a point / endpoint / vertex and apply a Vertical or Horizontal Distance Constraint to the origin, without ever having to select the origin first. Even more so when a Sketch has symmetry about the X, Y, or Z axis.

Additionally, when the user is zoomed in and the origin isn't visible, in order to select the origin as the second pick this also means that now the user has to zoom out first.


To begin with, you always have the option of going the old route and select first, then press shift+H or use the button every time. I should be putting in my mode as optional and add the option in preferences so that people can at least opt out/opt in. But even without it, the new method shouldn't kick in unless you have nothing selected.

The trade-off is unfortunately between user convenience and code size. As it is, the file is ~7000 lines long with features remaining to be added :roll:. To keep a small size, I'm handling all the element selection with a single object that takes in the sequences of element types and handles the selecting. That object is the reason you can see a new cursor and are prompted with the no-entry sign when hovering over the wrong sketch element.

Also, there's a UI trade-off as well :( . how do you imagine the workflow should go if you want both one-point and two-point selection. Say we have 2 points A and B to each constraint wrt the origin. The way you want it is

  1. you press the button and now you are in the selection mode
  2. you select point A, immediately the box pops up, you enter details
  3. you select point B, immediately the box pops up, you enter details

Now imagine you at some other point, with the same selection structure in place, wanted to constraint the horizontal dist bet points A and B. How do you want that to pan out?
User avatar
bejant
Posts: 4125
Joined: Thu Jul 11, 2013 3:06 pm

Re: Better selection system for constraints in Sketcher

Postby bejant » Sat Feb 11, 2017 3:18 am

jnxd wrote:how do you imagine the workflow should go if you want both one-point and two-point selection. Say we have 2 points A and B to each constraint wrt the origin. The way you want it is

you press the button and now you are in the selection mode
you select point A, immediately the box pops up, you enter details
you select point B, immediately the box pops up, you enter details


Now imagine you at some other point, with the same selection structure in place, wanted to constraint the horizontal dist bet points A and B. How do you want that to pan out?


In Sketcher I'd still like to be able to select one point of Sketcher geometry and without selecting the origin invoke the Horizontal or Vertical Distance Constraint, and then see the Insert Length pop-up input window so I can key in a Length. FreeCAD still works this way in:

OS: Ubuntu 16.04.1 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.10000 (Git)
Build type: None
Branch: master
Hash: 216d8c66dcc2ed92546e73b242e2123bda2b038e
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
My Part Design tutorials on YouTube (aimed at beginners).
jnxd
Posts: 127
Joined: Mon Mar 30, 2015 2:30 pm

Re: Better selection system for constraints in Sketcher

Postby jnxd » Sat Feb 11, 2017 9:35 am

bejant, I think you should be able to do that even bow (commit 10064, I think)
User avatar
bejant
Posts: 4125
Joined: Thu Jul 11, 2013 3:06 pm

Re: Better selection system for constraints in Sketcher

Postby bejant » Sat Feb 11, 2017 4:23 pm

OS: Ubuntu 16.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.10064 (Git)
Build type: None
Branch: master
Hash: d7ed8c4383f394f64dd9314eefa00efae02fb32f
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

Yes, I just tried it again using the above daily.

Sometimes the cursor indicator H or V for Horizontal and Vertical Constraints (not distance) didn't appear until I hovered the cursor over and edge so that it was pre-selected. The behavior is intermittent and I haven't figured out a way to reproduce it yet.

I added the red text into your quote so that I could reference them in my reply:
jnxd wrote:how do you imagine the workflow should go if you want both one-point and two-point selection. Say we have 2 points A and B to each constraint wrt the origin. The way you want it is
Scenario 1 (Constrain two different points a vertical or horizontal distance to the origin)
1. you press the button and now you are in the selection mode
2. you select point A, immediately the box pops up, you enter details
3. you select point B, immediately the box pops up, you enter details

Scenario 2 (Constrain two different points a vertical or horizontal distance to each other)
Now imagine you at some other point, with the same selection structure in place, wanted to constraint the horizontal dist bet points A and B. How do you want that to pan out?


Unless there is a way for the user to let Sketcher know whether the Length pop-up should appear after one point is selected or if that should wait until the second point is selected, we can't have both Scenarios (but I suppose a key press could serve that purpose, if you decide to implement it).

jnxd wrote:I should be putting in my mode as optional and add the option in preferences so that people can at least opt out/opt in.

Maybe the user would want to change modes more often, depending on whatever Sketch is open.
What do you (and anyone else who cares to ring in) think about a toggle button in the Sketcher Constraints toolbar instead?
Or maybe clicking a Constraint Button first, while no geometry is selected, enables Continuous Mode? This way the user could select say, the Coincident Constraint, do a Box Selection in the 3D view of some points / vertices, and upon release of LMB the Coincident Constraint is applied and Continuous Mode remains enabled. Just putting up some ideas here as I'm fiddling around with Sketcher...
My Part Design tutorials on YouTube (aimed at beginners).