[Resolved] PR #4942 new option to show/hide sketcher constraints
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: PR #4942 new option to show/hide sketcher constraints
I am trying to think this thru again.
There is one caveat. When I implemented what is called "hiding constraints", I was not implementing "hiding" of constraints. I was implementing a different concept called "virtual space". The idea was to be able to have (some) constraints in different "virtual spaces" and being able to switch between virtual spaces. It was intended as a functionality to enable to work in parts of a complex sketch without being cluttered by the rest. Ultimately, the community only saw merit in having one virtual space and use it to hide what is unwanted.
If one has all the constraints shown (in the first virtual space, which is made the real space), to hide all of them it suffices to make the second virtual space the real one, by pressing this forgotten button (without any selection):
https://wiki.freecadweb.org/Sketcher_SwitchVirtualSpace
This takes no time at all. It is instantaneous.
Now, I have to think how to match this concept with the showing only dimensionals...
There is one caveat. When I implemented what is called "hiding constraints", I was not implementing "hiding" of constraints. I was implementing a different concept called "virtual space". The idea was to be able to have (some) constraints in different "virtual spaces" and being able to switch between virtual spaces. It was intended as a functionality to enable to work in parts of a complex sketch without being cluttered by the rest. Ultimately, the community only saw merit in having one virtual space and use it to hide what is unwanted.
If one has all the constraints shown (in the first virtual space, which is made the real space), to hide all of them it suffices to make the second virtual space the real one, by pressing this forgotten button (without any selection):
https://wiki.freecadweb.org/Sketcher_SwitchVirtualSpace
This takes no time at all. It is instantaneous.
Now, I have to think how to match this concept with the showing only dimensionals...
Re: PR #4942 new option to show/hide sketcher constraints
A small demo video (this code is master since a long time):
Re: PR #4942 new option to show/hide sketcher constraints
Hello abdullah, I was not aware of the "Switch Virtual Space" Command.
Using the Commands "Switch Virtual Space" and "Select associated constraints" (this one is present in the RT branch and I do not know if it is also in the Master) it is easy to visualize only the constraints associated with a given geometrical element.
In fact after pressing "Switch Virtual Space" all constraint are hidden. Then selecting an edge and pressing "Select associated constraints" the edge related constraints are not only selected (in the Task View) but are also unhiden in the sketch view.
The selective hiding/unhiding of dimensional and non dimensional constraints would be a nice feature but not really necessary.
Using the Commands "Switch Virtual Space" and "Select associated constraints" (this one is present in the RT branch and I do not know if it is also in the Master) it is easy to visualize only the constraints associated with a given geometrical element.
In fact after pressing "Switch Virtual Space" all constraint are hidden. Then selecting an edge and pressing "Select associated constraints" the edge related constraints are not only selected (in the Task View) but are also unhiden in the sketch view.
The selective hiding/unhiding of dimensional and non dimensional constraints would be a nice feature but not really necessary.
Re: PR #4942 new option to show/hide sketcher constraints
I can confirm that "select associated constraints" is in master as I coded it some years ago.wsteffe wrote: ↑Sat Sep 18, 2021 7:16 pm Hello abdullah, I was not aware of the "Switch Virtual Space" Command.
Using the Commands "Switch Virtual Space" and "Select associated constraints" (this one is present in the RT branch and I do not know if it is also in the Master) it is easy to visualize only the constraints associated with a given geometrical element.
In fact after pressing "Switch Virtual Space" all constraint are hidden. Then selecting an edge and pressing "Select associated constraints" the edge related constraints are not only selected (in the Task View) but are also unhiden in the sketch view.
The selective hiding/unhiding of dimensional and non dimensional constraints would be a nice feature but not really necessary.
My post is not to be understood that it shouldn't be additional automation. Rather, it attempts to trigger the discussion to see how this is best automated, so that it is flexible enough to match several use cases, and thus becomes useful for a greater user base.
Re: PR #4942 new option to show/hide sketcher constraints
If I understand things right, the technique of hiding was already mentioned in the first post, but the performance was a problem if a sketch contained too many constraints.
Another - possibly related - thing I would like to see is the possibility to select all types of constraints separately, i.e. not only All/Normal (don't know the difference to All anyway)/Datums/Named/Reference, but also Tangent, Coincidence, ...
Another - possibly related - thing I would like to see is the possibility to select all types of constraints separately, i.e. not only All/Normal (don't know the difference to All anyway)/Datums/Named/Reference, but also Tangent, Coincidence, ...
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: PR #4942 new option to show/hide sketcher constraints
Would it be possible to have the same constraint in both virtual spaces ?
If true I would change the behaviour of switching to second VS in such a way that selected constraints are copied (and not moved).
The first VS would always show all the constraints and switching back to it would be equivalent to "Unhide all constraints".
The second VS would still show the constraints selected by the user.
The possibility to forget some constraints moved on the second VS would so be eliminated.
Re: PR #4942 new option to show/hide sketcher constraints
That part is implemented already in master (and should be part of RT unless he decided to remove it). The virtual spaces are mutually exclusive in the current implementation. The current implementation only supports two virtual spaces (with more than two one needs a more sophisticated management of virtual spaces). Because there was no much interest in having more virtual spaces, they were made exclusive. It is not a hard limitation, we can change behaviour if it fits better the user cases.wsteffe wrote: ↑Sun Sep 19, 2021 5:50 amWould it be possible to have the same constraint in both virtual spaces ?
If true I would change the behaviour of switching to second VS in such a way that selected constraints are copied (and not moved).
The first VS would always show all the constraints and switching back to it would be equivalent to "Unhide all constraints".
The second VS would still show the constraints selected by the user.
The possibility to forget some constraints moved on the second VS would so be eliminated.
There is one important aspect. Constraints are neither trully "moved" nor "copied". It is a mere visibility arrangement (that is why I was surprised of the time it takes when going through the widget). The more I look into it, the more I tend to think that the widget is not the right place for this. Rather, buttons with commands rearranging the visibility of groups of constraints belong to the toolbar next to the "switch virtual space" button. I think that would be efficient and intuitive, leaving the widget for fine-tunning visibility of individual constraints. This would also reduce the bloating of the constraint widget with buttons. I am still thinking about it.
The idea should also play well with future "geometry layers" feature. This will enable geometry to be arranged in layers (that is both a visibility and a functional arrangement). It should enable a more powerful carbon copy. However, constraints may be cross layer (for example, when a sketch has "imported" another via carbon copy and coincidents between sketches are introduced).
Re: PR #4942 new option to show/hide sketcher constraints
Yes, a way of hiding was shown. Not the use of the "switching virtual space". The latter is very efficient (it is instantaneous with a high amount of constraints). It has limitations, as it is only a show all/hide all tool when one virtual space is empty. Otherwise it is a switch between mutually exclusive sets of constraints.chrisb wrote: ↑Sat Sep 18, 2021 9:54 pm If I understand things right, the technique of hiding was already mentioned in the first post, but the performance was a problem if a sketch contained too many constraints.
Another - possibly related - thing I would like to see is the possibility to select all types of constraints separately, i.e. not only All/Normal (don't know the difference to All anyway)/Datums/Named/Reference, but also Tangent, Coincidence, ...
I will review the filter of the widget.
Re: PR #4942 new option to show/hide sketcher constraints
I agree on this point. But the virtual space switching could still play a role.
If the mutual exclusivity were removed the 2 Virtual Spaces (or a number of VS > 2) could store different settings of constraint visualization.
In my opinion it would be a nice feature.
Re: PR #4942 new option to show/hide sketcher constraints
I may be one of the rare users, who had waited for more virtual spaces. If constraints can be shown in multiple virtual spaces, it could be used to have a virtual space for each type of constraint plus one for all, plus custom user spaces.
Just dreaming.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.