[New feature] Sketcher Constrain Contextually

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Haavard
Posts: 221
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

I agree, much better to get the first version merged when its ready, so more people can test and give their opinion. Lets keep the feature creep away for now :) I will see if i dare look at the source code this weekend, perhaps i can help polish the text strings a bit.
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Haavard wrote: Thu Jan 27, 2022 2:45 pm I agree, much better to get the first version merged when its ready, so more people can test and give their opinion. Lets keep the feature creep away for now :) I will see if i dare look at the source code this weekend, perhaps i can help polish the text strings a bit.
Sooooo after 8 hours on that space key issue the problem is still standing...
For now I switched back to shift. But it does not solve the space key toggling on and off the visibility of the sketch :?

Which is not a fatal flaw but annoying behaviour. Especially because it prevents us to use Space key. :(

Beside after capitulating I improved some things on the constrain tree. Prevented the tool from offering parallel or perpendicular if both lines are vertical/horizontal for instance.

Symmetric constrain is added for 3 points, 1point 1 line, 2 points 1 line.

I havent removed parallel + distance mode for now. But yeah maybe it's overkill I'll think about it some more.

Topic standing :
- Polishing the constrain tree to get the most intuitive/usefull combo. Also it needs to test the tool, find errors, in the hints also.
- Space key issue. Which is a problem of sending the complete focus back to the ViewproviderSketcher...
- Moving the constraints slightly shifted to avoid cluttering the mouse pointer.
- ?

Github updated if you want to try.
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Haavard wrote: Thu Jan 27, 2022 2:45 pm I agree, much better to get the first version merged when its ready, so more people can test and give their opinion. Lets keep the feature creep away for now :) I will see if i dare look at the source code this weekend, perhaps i can help polish the text strings a bit.
Some comments on your PDF :
- 1 point : autodimension to the origin is an interesting idea. Though I don't know if distance to origin is really useful.
edit: Changed to lock, autodimensions.
- 2 points : horizontal/vertical? edit: oh I didn't knew that it was possible. I actually tried to implement that for 3+ points but using distanceX/Y which is ugly. Thanks for the tip I'll add that.
edit2:So I added horizontal/vertical for 2+ points
- 3points : coincident, symmetry, horizontal, vertical
- 4+points coincident, horizontal, vertical
- 1line : autodimension, vertical horizontal (it wasn't working due to space key bug)
- 2lines : tangent?
Haavard
Posts: 221
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

paddle wrote: Thu Jan 27, 2022 9:48 pm Some comments on your PDF :
- 1 point : autodimension to the origin is an interesting idea. Though I don't know if distance to origin is really useful.
edit: Changed to lock, autodimensions.
- 2 points : horizontal/vertical? edit: oh I didn't knew that it was possible. I actually tried to implement that for 3+ points but using distanceX/Y which is ugly. Thanks for the tip I'll add that.
edit2:So I added horizontal/vertical for 2+ points
- 3points : coincident, symmetry, horizontal, vertical
- 4+points coincident, horizontal, vertical
- 1line : autodimension, vertical horizontal (it wasn't working due to space key bug)
- 2lines : tangent?
Just my rationale:
-1 point: i just really enjoy using the "autodimension" feature, in my mind it replaces horizontal and vertical length since you have both by moving the mouse..
- Yeah horizontal and vertical constraint on points is used just as much as on lines, at least on my sketches :)
- I feel like coincident as default, and symmetry as second option worked very well in the last commit! Nice!
- 2 lines tangent: this is useful when two lines must be "on axis", but can also be constrained by making them parallel and 0mm (or point on object).

Now off to test some more :ugeek:
Haavard
Posts: 221
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

And i hope some others are also testing this, i don't want to let my biases push the development in a wrong direction ;)
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Haavard wrote: Thu Jan 27, 2022 10:10 pm
paddle wrote: Thu Jan 27, 2022 9:48 pm Some comments on your PDF :
- 1 point : autodimension to the origin is an interesting idea. Though I don't know if distance to origin is really useful.
edit: Changed to lock, autodimensions.
- 2 points : horizontal/vertical? edit: oh I didn't knew that it was possible. I actually tried to implement that for 3+ points but using distanceX/Y which is ugly. Thanks for the tip I'll add that.
edit2:So I added horizontal/vertical for 2+ points
- 3points : coincident, symmetry, horizontal, vertical
- 4+points coincident, horizontal, vertical
- 1line : autodimension, vertical horizontal (it wasn't working due to space key bug)
- 2lines : tangent?
Just my rationale:
-1 point: i just really enjoy using the "autodimension" feature, in my mind it replaces horizontal and vertical length since you have both by moving the mouse..
- Yeah horizontal and vertical constraint on points is used just as much as on lines, at least on my sketches :)
- I feel like coincident as default, and symmetry as second option worked very well in the last commit! Nice!
- 2 lines tangent: this is useful when two lines must be "on axis", but can also be constrained by making them parallel and 0mm (or point on object).

Now off to test some more :ugeek:
Oh yes tangent is good indeed. I have a lot of time where I needed that and never thought of using tangent between lines.
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Haavard wrote: Thu Jan 27, 2022 10:15 pm And i hope some others are also testing this, i don't want to let my biases push the development in a wrong direction ;)
I added a few combinaisons, and solved few bugs. But mostly I cleaned the code so that you can have a look at the IF tree.
I tried to prevent overconstraints. So for instance if 2 lines are already parallel, then the tangent deletes the parallel before applying. This way you can make tangent even if line are parallels

It's in the function makeAppropriateConstraint

With this you should be able to understand what behaviour is expected where (kind of your PDF).

If you can check it out and repport any issue or uncaught behaviours !
fortress_bravo
Posts: 7
Joined: Thu Feb 03, 2022 10:28 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by fortress_bravo »

I see that this (and the tool settings PR) hasn't yet been merged. Are there any blockers preventing it from going in?
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

fortress_bravo wrote: Thu Feb 03, 2022 10:51 pm I see that this (and the tool settings PR) hasn't yet been merged. Are there any blockers preventing it from going in?
As GeneFC pointed out in PR topic, it's a big feature so it may take a while to merge.
Also Abdullah, the main Sketcher Merger, is currently not available. I seem to recall he told he'll be back end of February.
Hope it'll get merged then :)
In the meantime I'm improving some small things and looking for the eventual bug.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Kunda1 »

paddle wrote: Fri Feb 04, 2022 7:59 pm In the meantime I'm improving some small things and looking for the eventual bug.
:+1:
Thanks for you patience and all your efforts!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply