[To be reworked] Sketcher Tool settings : testers welcome!

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
paddle
Veteran
Posts: 1396
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher Tool settings : testers welcome!

Post by paddle »

Haavard wrote: Sun Apr 24, 2022 12:21 pm I might have found some more bugs in the tool widget:
Since Auto Constraint is enabled by default, there seems to be a bug in the line tool.
It appears as if the tool widget applies a horizontal constraint if angle is set to 0 or 180, and a vertical constraint if angle is 90 or 270.
However, i think the auto constraint also adds this constraint, so you end up with two:

Another detail with the line tool, in mode "2 points":
- There is a small string error, all four says "x/y of 2. point"
- If both points have the same x coordinate, should the tool perhaps only constrain one of the points with a horisontal dimension, and let autoconstraint apply the vertical constraint? And the same for Y/horizontal.
Peek 2022-04-24 two points horizontal.gif
@Abdullah what do you think is the best for this auto constraint redundant problem? I have an idea but it may feel hacky ?

Code: Select all

in autoconstrain function : 
if ( !(parameter 4 is set) || !(autoconstraint is horizontal or vertical)
	apply auto constraint 
By the way the same redundant problem happens if you enter an angle which is in the horizontal autoconstraint limits (1 degree for example).

- I pushed for the "2nd point" typo.

- yes you are right if both points have same X or Y it would be better if second constraint is not added and vertical horizontal is used instead. I just pushed it.
User avatar
BrandonGene
Posts: 14
Joined: Tue Jan 12, 2021 8:00 pm
Location: Wisconsin

Re: Sketcher Tool settings : testers welcome!

Post by BrandonGene »

BrandonGene wrote: Thu Apr 21, 2022 3:42 pm Is this maybe a good distinction with which to draw some lines?:

If the resulting geometry is different, then it remains a separate tool. If there are multiple ways to construct the same geometry, then they are merged and M cycles between them.

...

This also means that the M key only has to cycle between two options in all these instances, which I'm a really big fan of as well. This obviates the need for "hidden" tools that only show up in the keyboard shortcuts or are eliminated from the toolbar, since 3 keys is totally fine for practically everything. Thoughts?
Just want to double-check that no one feels this is the right direction. Paddle brought up that rounded rectangle+frame would have to become a new tool (fair point) but that's still after eliminating 4 others. This avoids introducing the inconsistency of "this shortcut launches a tool" and "this shortcut launches the same exact tool except..."

It could be a good way to define what constitutes a new tool and what constitutes an "option" for an existing tool into the future as features are added. It's a nice clean implementation that eliminates a lot of other questions about how the keyboard shortcuts work, but I'm not gonna die on that hill either. ;)



Assuming everyone is leaning towards "merge all the rectangle features" rather than my post above, then there is the last point to figure out about shortcuts.

@abdullah is already very close on this. Make a command available that can have a shortcut assigned to it for every combination of options (checkboxes). This is, in my opinion, an absolute necessity. However, it's up in the air if we should also create separate commands for different construction modes and all of those combinations as well.

Let's consider what the two end results would be for rectangle:

Option A: Create commands to support every possible combination of tool settings, including construction modes:
-- Regular rectangle centered
-- Regular rectangle corner/corner
-- Regular rectangle with frame centered
-- Regular rectangle with frame corner/corner
-- Rounded rectangle centered
-- Rounded rectangle corner/corner
-- Rounded rectangle with frame centered
-- Rounded rectangle with frame corner/corner

Option B: Create commands only for the checkbox combinations and leave construction mode as a separate toggle:
-- Regular Rectangle
-- Regular Rectangle with Frame
-- Rounded Rectangle
-- Rounded Rectangle with Frame

Option B seems nice and clean, right? But here's the kicker...that's not actually the entire list of shortcuts. The entire list of shortcuts is exactly the same as Option A! But they just aren't exposed/customizable any more with Option B because the Toggle key hides the two construction modes behind the primary shortcut. I think this may leave some folks upset as some commands/shortcuts will stop being customizable. If I had rectangle set to RR and rectangle from center set to RC, the rectangle from center option now must be RRM and can't be changed. Same for Arc/Arc-by-Rim-Points, Circle/Circle-by-3-Points, Fillet/Constraint-preserving-Fillet. We've just added an extra keystroke to 4 shortcuts with no way to change them.

Who's to say what the "primary" construction mode is, anyway? Maybe I want to change the tool's default construction mode. With Option B it isn't possible: I have to Toggle every time to get to my preferred tool. With Option A it would be no problem at all to change the shortcut I'm using over to the construction mode of Rectangle or Arc or Circle that I use the most rather than the default construction mode.

Tl;dr: I am in strongly in favor of creating a command for every combination of tool settings (including construction modes) to be tucked away in the shortcut manager so that everything remains customizable instead of locked behind the "primary" tool's shortcut.
Last edited by BrandonGene on Mon Apr 25, 2022 6:51 pm, edited 1 time in total.
User avatar
BrandonGene
Posts: 14
Joined: Tue Jan 12, 2021 8:00 pm
Location: Wisconsin

Re: Sketcher Tool settings : testers welcome!

Post by BrandonGene »

BrandonGene wrote: Mon Apr 25, 2022 6:38 pm Who's to say what the "primary" construction mode is, anyway? Maybe I want to change the tool's default construction mode. With Option B it isn't possible: I have to Toggle every time to get to my preferred tool. With Option A it would be no problem at all to change the shortcut I'm using over to the construction mode of Rectangle or Arc or Circle that I use the most rather than the default construction mode.
This brings up one more thing...if I'm a mouse user and all these toolbar buttons are merged, I'm going to lose the "last used" feature for these construction modes where the toolbar button changes depending on my last selection of a dropdown tool. Now to use the Arc from 3 Points, I would have to click Arc in the bar and then change the dropdown box way over on the side. I think a really nice addition to the tool widget would be a checkbox at the bottom for "Remember Settings". Check the box and next time the tool opens from its top-level shortcut or a toolbar click then it will be what it was when you left it last. Uncheck the box and every time you open it it's back to the default settings.

Again, only for the top-level shortcut or toolbar click. If Rectangle is RR, then the checkbox matters when you press RR or click the toolbar icon for Rectangle. But if you press RC for Rectangle (Centered), then we ignore the Remember Settings button as you circumvented the default tool.
Last edited by BrandonGene on Mon Apr 25, 2022 7:14 pm, edited 1 time in total.
User avatar
BrandonGene
Posts: 14
Joined: Tue Jan 12, 2021 8:00 pm
Location: Wisconsin

Re: Sketcher Tool settings : testers welcome!

Post by BrandonGene »

abdullah wrote: Sat Apr 23, 2022 9:28 pm I must admit that I am not extraordinarily happy with the polygon tool hiding the rectangle tool due to the current grouping. I understand this gives me extra space in the toolbar. I can certainly live with it. Still, I wonder, if it is the right call. It is quite often used. On the other side, I seldom use the polygon tools, so maybe I would not be put in a situation of having to drop the toolbar icon to get the rectangle tool often. So it may be fine. It is indeed difficult to decide (for me). I have seen no strong complains about this, and that surprises me... Hey folks, what do you think we should do?
I did not notice the polygons within Rectangle before voting. I am definitely not a fan of this. A rectangle is not a Regular Polygon.
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: Sketcher Tool settings : testers welcome!

Post by Haavard »

Wow, there is a lot of text in these last couple of pages :lol:
I tried reading through again, and it feels as if we're fairly aligned in our views.

Please correct me if i'm wrong, but is this a fair summary so far?:
- M key should only toggle "Mode"
- Separate shortcuts for the checkboxes
- Shortcuts to launch the most used configurations should be available for customization (launch center rectangle "directly" from shortcuts for example)
- Bring back the polygon icon
- Mixed feelings if tool settings should remember the last used mode
- This tool it freaking awesome and Paddle and Abdullah are the sketcher powercouple ;)

And a reminder for everyone that this branch is ready for testing via snap, so you can install and test (install ubuntu in a VM if you're on windows or mac) :idea:
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: Sketcher Tool settings : testers welcome!

Post by Haavard »

Regarding tool widget shortcuts, how about a visual que?
Two examples:
Underscore the shorcut key (left), or a text/string indicator (right)
Tool settings shortcuts.png
Tool settings shortcuts.png (31.39 KiB) Viewed 1500 times
User avatar
BrandonGene
Posts: 14
Joined: Tue Jan 12, 2021 8:00 pm
Location: Wisconsin

Re: Sketcher Tool settings : testers welcome!

Post by BrandonGene »

Haavard wrote: Mon Apr 25, 2022 9:00 pm Wow, there is a lot of text in these last couple of pages :lol:
I tried reading through again, and it feels as if we're fairly aligned in our views.
It seems we're getting close, yes!
Haavard wrote: Mon Apr 25, 2022 9:00 pm - M key should only toggle "Mode"
Definitely.
Haavard wrote: Mon Apr 25, 2022 9:00 pm - Separate shortcuts for the checkboxes
I don't think this was settled on, yet. Abdullah pointed out that it has a very strong possibility of creating shortcut conflicts while a tool is open and I'm inclined to agree. I believe he figured the best solution to this was exactly your next line:
Haavard wrote: Mon Apr 25, 2022 9:00 pm - Shortcuts to launch the most used configurations should be available for customization (launch center rectangle "directly" from shortcuts for example)
If this part gets implemented, then instead of having a shortcut to change a checkbox within the tool, you would just use the shortcut to launch the tool in the configuration that already has it checked. For example, instead of opening Rectangle with RR and then pressing F to toggle Frame, your shortcut might be RF to activate the "Rectangle with Frame" shortcut. Especially if RealThunder's new shortcut work is merged, then all the different shortcut combinations actually have a chance of being short and memorable.
Haavard wrote: Mon Apr 25, 2022 9:00 pm - Bring back the polygon icon
Yes please! :D
Haavard wrote: Mon Apr 25, 2022 9:00 pm - Mixed feelings if tool settings should remember the last used mode
Yes, a little mixed so far but I think the lean is more towards not remembering settings? If the settings are remembered, then there is a problem with repeatability of shortcuts where "RR" for the Rectangle Tool could do 8 different things depending on what the last use was.

After thinking more about my suggestion to include a "Remember Settings" checkbox in each tool widget, I have actually come to dislike it. Just like with the shortcut of RR doing 8 different things, now clicking the icon can do 8 different things. If I don't remember if a tool will be the correct thing when I click its icon (very likely I will not remember), then a Remember Settings checkbox doesn't even matter because I'm going to click the rectangle button and look through all my settings to confirm it is what I intended.

For the sake of mouse-heavy users, I think we should use @cadcam's idea of a dropdown for each tool and not merge the buttons at all. In fact, we'll end up with more buttons! :? They won't take up more space than now, as any extras will be in the dropdowns.

Rather than just "Rectangle", Rectangle is now a dropdown with all 8 versions. Then a mouse user could select their preferred settings for that tool with (at most) two clicks, and without having to check their tool settings every time. For a mouse user to get a centered rounded framed rectangle with merged buttons, it would take...

Click toolbar icon
Move halfway across screen
Click mode dropdown
Click centered
Check frame
Check rounded corners

For a dropdown list in the toolbar, it's

Click dropdown arrow,
Click appropriate icon

It would also make the default tool the most recently used one just like it does now for dropdowns, so sometimes it would be a single click. This is just the same as "Remember Settings", but with the huge bonus of actually seeing those settings visually represented right there in the icon that you click. This leaves nothing for you to remember at all.

It usually feels "cleaner" for there to be only one way to do things. I understand why it is so tempting to merge all these buttons once widget settings are a thing. But keyboarding and mousing are so different; I think we should do everything we can to support both workflows even if it results in a little bit of visual clutter. Only mousers will see the clutter regularly, and those are the folks who will get good use out of it. Having a full dropdown of options would also be a good place to put shortcut tooltips so mousers may become keyboarders in the future. Even as a fulltime keyboarder I definitely need a reminder now and then.

On the other hand, this isn't considering the frequency of use. Maybe Regular Rectangle is used 90% of the time and the other 10% is fine to mouse over for. It's so hard to know. :(
Haavard wrote: Mon Apr 25, 2022 9:00 pm - This tool it freaking awesome and Paddle and Abdullah are the sketcher powercouple ;)
100%, they are killing it. I'm very grateful and can't wait to see this merged.
Last edited by BrandonGene on Tue Apr 26, 2022 5:22 pm, edited 1 time in total.
User avatar
BrandonGene
Posts: 14
Joined: Tue Jan 12, 2021 8:00 pm
Location: Wisconsin

Re: Sketcher Tool settings : testers welcome!

Post by BrandonGene »

Haavard wrote: Mon Apr 25, 2022 9:30 pm Regarding tool widget shortcuts, how about a visual que?
Two examples:
Underscore the shorcut key (left), or a text/string indicator (right)

Tool settings shortcuts.png
Underlining the shortcut character and making it Alt+R or Alt+F could be a possibility? I believe Alt+Char is practically reserved for exactly these sorts of situations, though the menu bar does already consume some characters. Apparently MS refers to them as "Access Keys": https://docs.microsoft.com/en-us/previo ... ccess-keys

*shrug* Another thought, anyway. Also not sure if this is consistent across multiple operating systems.
KAKM
Posts: 109
Joined: Tue May 04, 2021 12:17 am

Re: Sketcher Tool settings : testers welcome!

Post by KAKM »

Haavard wrote: Mon Apr 25, 2022 9:30 pm Regarding tool widget shortcuts, how about a visual cue?
Two examples:
Underscore the shortcut key (left), or a text/string indicator (right)
I personally like the righthand (indicator) option–the underscore (especially if it's the first letter(s)) is too easy to miss or mistake for some weird formatting issue. The fact that I'm used to seeing parentheses as an alternate option or a clarification also makes the mental jump to "this is the shortcut for this command" a lot easier–before I re-read the post more closely, I thought the left hand image was what's currently there (with no shortcut marked) and the right was what it could look like if the shortcut annotations were added.
BrandonGene wrote: Tue Apr 26, 2022 4:46 pm *shrug* Another thought, anyway. Also not sure if this is consistent across multiple operating systems.
I'm pretty sure Access Keys are a just a Windows thing. As far as I know, that's not used on Mac. The only times I've used the Alt/Option key at all are for producing special characters (Option+P is π, for example) and in a few complicated shortcuts (and a fair number of those that I've attempted to use didn't work).
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher Tool settings : testers welcome!

Post by abdullah »

paddle wrote: Mon Apr 25, 2022 2:59 pm @Abdullah what do you think is the best for this auto constraint redundant problem? I have an idea but it may feel hacky ?
It is indeed a problem. But it is a general one. There will be potential issues with all widget mandated constraints and autoconstraints. A general problem calls for a general solution. I am thinking to be proactive and implement a mechanism to detect these situations and drop the widget mandated constraints if they would be redundant/conflicting. The solver can do that.
Post Reply