[Resolved] PR #4942 new option to show/hide sketcher constraints

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Locked
chrisb
Veteran
Posts: 54168
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #4942 new option to show/hide sketcher constraints

Post by chrisb »

You are right, "Missing coincidences" and "Open vertices" could well be available inside of Sketcher, making also the handling of construction geometry more intuitive.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: PR #4942 new option to show/hide sketcher constraints

Post by GeneFC »

abdullah wrote: Tue Sep 21, 2021 3:03 pm For those who want to play
I just played. Looks really good.

I did not see any problems, and the new options seemed quite complete and useful.

Nice!

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.25786 (Git)
Build type: Release
Branch: Master
Hash: f7bdd2c5e857e59e3d1bf8f4da1a533904a67b51
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

Gene
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

chrisb wrote: Tue Sep 21, 2021 8:53 am You are right, "Missing coincidences" and "Open vertices" could well be available inside of Sketcher, making also the handling of construction geometry more intuitive.
If it is not in the tracker, it would make sense.

Since last year (trimming circles) there is a layer for markings. It might be possible to reuse it for this. If not, creating one is also well doable.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

wsteffe wrote: Tue Sep 21, 2021 1:48 am
chrisb wrote: Mon Sep 20, 2021 8:52 pm That could be nice, but it would require a different widget. And that would probably require more space, which I wouldn't like to see at all.
Not much more space. The Visualization Flag could be replaced by a couple of Flags: Hide and Unhide.
When Unhide is checked every time you enter a filter type that type is made visible without hiding any other already visible type.
The logic of the virtual spaces resides currently in the constraint and the sketch. There is no object "virtual space".

Multiple virtual spaces without mutually exclusivity would require that a constraint stores the plurality of virtual spaces in which it is visible. The sketch knows which virtual space is the one being shown.

The current multi-filter implementation works with two virtual spaces, meaning that it modifies the visible virtual space correspondingly.

A generalisation to several virtual spaces is possible. If a hidden virtual space is wanted, the Nth virtual space can be made to be the hidden, and any constraint not in the first N-1 assigned to the Nth. However, there is a need of additional UI to manage this. For user virtual spaces, at least the possibility of adding a virtual space, possibly naming it to make it meaningful, deleting it when it is no longer necessary.

The current work is a differential improvement. This will need change when implementing layers for geometry (there should be the option, probably checked by default, that what is shown is not only limited by the filter selection, but also to constraints corresponding to geometry in layers that are visible). When that part is working, we should reflect if we want more than two virtual spaces and if so, define the requirements.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

chrisb wrote: Mon Sep 20, 2021 10:28 pm
Shalmeneser wrote: Mon Sep 20, 2021 9:14 pm transitive hull of equalities ???
- Consider 4 lines A, B, C, D
- with constraints A eq B, B eq C, C eq D

Then the transitive hull contains all equalities which can be derived from this, i.e. in addition to the above:
A eq C, A eq D, B eq D.

I think a general - geometric/algebraic - derivation is beyond of what should be done. Doing this numerically as I understand your proposal seems to me to be only of limited value.
Wouldn't just showing the lines that are equal in length (example restricted to lines) do, disregarding the actual existing constraints?

This may be what "autoConstraint", or better said, "detectMissingEqualityConstraints" does (My memory fails me. I am getting old.).
https://forum.freecadweb.org/viewtopic. ... 95#p260195

If it is, then this may be "resolved" along the showing the open vertices and missing coincidents. It is just showing markers where this routine says equalities are missing...
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

chrisb wrote: Mon Sep 20, 2021 8:56 pm
Shalmeneser wrote: Mon Sep 20, 2021 4:43 pm I dream that when selecting one dimension, all lines with the same dimension get highligthed.
+1 (if you mean the transitive hull of equalities, and not repeated dimensions, which is another issue).
Ah! I see that in the previous post I was not replying to your hull of equalities, but to the OP's request for same dimensions.

Yes, then it is different. This one is indeed related only to constraints and not to unconstrained elements... gotta think about it...
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

C_h_o_p_i_n wrote: Mon Sep 20, 2021 4:01 pm Hello Abdullah,

while I can't say often enough: thank you so very much (!) for your efforts on the sketcher-wb I'd like to ask:
Will the planed/evaluated improvements too offer/establish any possibility to allow sketches to be exported as dxf or into techdraw ?

Could this eventually be taken into account?

Best regards,
Stefan
One needs to see the limitations. Draft dimensioning is generally not done the same way as Sketcher dimensioning. So any attempt of "exporting" constraint-dimensions, may not be what is wanted. Even for the very avid user that manages to constraint in the Sketcher thinking to reuse it for TechDraw, the effort would be on the TechDraw part of FreeCAD...

... you need to convince a TechDraw developer ... I see myself winning the Lotto before I implement that (Note: I do not play the Lotto)... :?
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4942 new option to show/hide sketcher constraints

Post by abdullah »

uwestoehr wrote: Mon Sep 20, 2021 5:40 pm
abdullah wrote: Mon Sep 20, 2021 12:49 pm Short story long
-> The Sketcher will have layers for geometry (hopefully before the end of the year).
...
Sorry it is taking me longer than expected...
Please don't feel under pressure. We are all not employed by FC thus can take the time we want ;)

Concerning your layer solution, I already use layers. What I had in mind was the simplest possible solution. Therefore I thought a method to just hide/show the different annotations in a single layer.

As I understand you having e.g. a layer for every annotation type (datums, dimensions, etc.) is technically an advantage to offer a quick toggling between showing/hiding the different layers. Sounds good.

So as soon as it is simple - the user must not take care of the different layers and can just press a button or select an option to hide/show annotation, I am happy with every solution.
It is ok. I started were you left it because of the checkbox/button issue. People suggested... I was weak. One thing let to another. :lol:

"Layer" officially will be like Gimp layers and for geometry only. Constraints is a different animal that lives in a virtual space and is associated to possibly different layers (as it may constraint geometries in different layers).

The current implementation uses only two virtual spaces. The active virtual space (the one being shown) is modified to adapt to the filter in real time. The virtual spaces are mutually exclusive.

Give it a go and let me know if you see short-comings.
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: PR #4942 new option to show/hide sketcher constraints

Post by wsteffe »

[
abdullah wrote: Tue Sep 21, 2021 6:18 pm he logic of the virtual spaces resides currently in the constraint and the sketch. There is no object "virtual space".
Hello abdullah, I think that you have misunderstood the post that you have quoted in this replay.
I and chrisb were speaking about the space taken on the screen by the your widget, not about virtual spaces.

I have just said that, the simultaneous visualization of more constraint types (not just one type at time) could be easily implemented with a small change of your widget. The change would be to replace the Visualization Check Button with a couple of Check Buttons named Hide/Unhide (or Hide/Show if you prefer). The increasing of dimension (and complexity) of your widget would be very small.
Locked