[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!
Post Reply
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

[New feature] Sketcher Constrain Contextually

Post by paddle »

Note the video is out of date with what actually merged.
phpBB [video]


A tool that create constraints depending on what you click!

Github branch if you want to test : https://github.com/PaddleStroke/FreeCAD ... Contextual

Feature discussion : https://forum.freecadweb.org/viewtopic.php?f=19&t=64648
Pauvres_honteux wrote: Mon Dec 20, 2021 9:25 pm issue #1416 Constraints creation "on the fly"

Surprise!
adrianinsaval wrote: Mon Dec 20, 2021 5:59 pm This would be a welcomed addition by most people I think, also consider making the m key switch between the different constraints available for the selection.
Yes a key to change between available constraints is the next step. Though it's already pretty cool now. :D
Last edited by paddle on Fri Sep 01, 2023 5:52 am, edited 2 times in total.
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

WOW, great job! Been dreaming about a feature like this since i started using freecad years ago :D
This looks like a really poweful tool which should speed up constraining quite a lot. Will give it a test this weekend and give more feedback.

Small suggestion for now:
1: Could the auto diameter/radius tool be used instead of diameter as default? So that if you select a circle you get diameter, and radius for an arc?

2: Other software will automatically switch between horizontal length, vertical length or distance, based on mouse position:
length tool.png
length tool.png (17.94 KiB) Viewed 41043 times
- Say you click on line A, you will only get vertical length as an option, or horizontal for B.
- If you click C, the position of the mouse in relation to the "projection" of the line will determine if distance or horizontal/vertical length should be applied.

I have no idea if this is hard to implement, perhaps just checking if the line is already axially constrained, and if so switch from distance to horizontal/vertical is good enough?
Last edited by Haavard on Sun Jan 23, 2022 4:30 pm, edited 1 time in total.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by adrianinsaval »

Great! I'll try to take a better look later
bleber
Posts: 259
Joined: Thu Jun 30, 2016 5:12 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by bleber »

How about more dinàmic construction with poliline, it is extensively used for speed modelling profiles.
i like to see enter dinamically constraints when enter diferent segments and change type segment with m key.
Thanks.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Haavard wrote: Thu Jan 20, 2022 11:34 pm WOW, great job! Been dreaming about a feature like this since i started using freecad years ago :D
This looks like a really poweful tool which should speed up constraining quite a lot. Will give it a test this weekend and give more feedback.

Small suggestion for now:
1: Could the auto diameter/radius tool be used instead of diameter as default? So that if you select a circle you get diameter, and radius for an arc?

2: Other software will automatically switch between horizontal length, vertical length or distance, based on mouse position:

- Say you click on line A, you will only get vertical length as an option, or horizontal for B.
- If you click C, the position of the mouse in relation to the "projection" of the line will determine if distance or horizontal/vertical length should be applied.

I have no idea if this is hard to implement, perhaps just checking if the line is already axially constrained, and if so switch from distance to horizontal/vertical is good enough?
1 - I think that depends a lot on user preferences. Myself I prefer to always use radius as it's more consistent to use always the same. Using both diameter and radius requires more brain-power to not make mistake IMO.

2- This is a really great idea! I'm totally going to make it.
bleber wrote: Fri Jan 21, 2022 1:36 am How about more dinàmic construction with poliline, it is extensively used for speed modelling profiles.
i like to see enter dinamically constraints when enter diferent segments and change type segment with m key.
Thanks.
Are you talking about that ? https://forum.freecadweb.org/viewtopic.php?f=9&t=65279
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Haavard wrote: Thu Jan 20, 2022 11:34 pm 2: Other software will automatically switch between horizontal length, vertical length or distance, based on mouse position:

- Say you click on line A, you will only get vertical length as an option, or horizontal for B.
- If you click C, the position of the mouse in relation to the "projection" of the line will determine if distance or horizontal/vertical length should be applied.
That's it it's working and it's awesome! Thanks for the idea!
phpBB [video]
Last edited by paddle on Fri Jan 21, 2022 9:51 am, edited 1 time in total.
User avatar
bambuko
Veteran
Posts: 2165
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by bambuko »

paddle wrote: Fri Jan 21, 2022 8:20 am ...Myself I prefer to always use radius as it's more consistent to use always the same. Using both diameter and radius requires more brain-power to not make mistake IMO...
Like the whole idea very much apart from radius ve diameter business.
I have reasons to use one or the other as necessary and if anything using radius on the feature that requires me to know the diameter require more brain power ;)
You might prefer radius, but there is a whole bunch of us who prefer to make this decision ourselves, please :ugeek:
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

bambuko wrote: Fri Jan 21, 2022 9:36 am
paddle wrote: Fri Jan 21, 2022 8:20 am ...Myself I prefer to always use radius as it's more consistent to use always the same. Using both diameter and radius requires more brain-power to not make mistake IMO...
Like the whole idea very much apart from radius ve diameter business.
I have reasons to use one or the other as necessary and if anything using radius on the feature that requires me to know the diameter require more brain power ;)
You might prefer radius, but there is a whole bunch of us who prefer to make this decision ourselves, please :ugeek:
I don't specifically prefer one or the other. I prefer that it stays the same.

Though one possibility is to have a key which alternate between the available constraint.
So you select a circle/arc, then it creates the radius constraint. Click on 'Shift' key. Then it changes to diameter.

Would that be what you're looking for?
User avatar
bambuko
Veteran
Posts: 2165
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by bambuko »

paddle wrote: Fri Jan 21, 2022 9:54 am ... I prefer that it stays the same...
I know you do :)
and I know CAD doesn't care (as long as it is constrained), but I (as a designer) do care whether it is one or the other.
paddle wrote: Fri Jan 21, 2022 9:54 am ...Though one possibility is to have a key which alternate between the available constraint...
I am normally a "mouse man" so would prefer context mouse click to allow choice, but keyboard key is usable as well

paddle wrote: Fri Jan 21, 2022 9:54 am ....So you select a circle/arc, then it creates the radius constraint. Click on 'Shift' key. Then it changes to diameter.
Would that be what you're looking for?
Yes, I would be looking for a choice at this point,
if "Shift" key is the way, then I am sure I could get used to it, although as mentioned above would prefer to use a mouse (or "shift" key for those who prefer keyboard - I know a lot of Linux guys like keyboard shortcuts ;) )
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

paddle wrote: Fri Jan 21, 2022 9:34 am
Haavard wrote: Thu Jan 20, 2022 11:34 pm 2: Other software will automatically switch between horizontal length, vertical length or distance, based on mouse position:
That's it it's working and it's awesome! Thanks for the idea!
Absolutely brilliant!!! I'm in awe :shock: Been thinking about this feature for years, but have not had time to learn c++ and attempt it myself yet.
Hopefully someone can clone this feature in techdraw, that would make dimensioning drawings a blast :D

Getting off work soon, will try to compile and test.
Post Reply