[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!
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by bambuko »

drmacro wrote: Fri Jan 21, 2022 6:30 pm ...I shouldn't need a cheat sheet hanging on sticky notes around my monitor. ...
Sorry, I just see so many full on additions that would be good in sketcher and selecting constraints is already functional...just click a boomin icon....
maybe I am also an old fart :lol:
but +1 +10 +100

off to click some icons ;)
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
kaih
Posts: 123
Joined: Tue Dec 31, 2019 12:45 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by kaih »

paddle wrote: Fri Jan 21, 2022 6:09 pmWhat they ask for is the automatic choosing of radius when it's an arc, and of diameter when it's a circle. But all people do not agree this is the best behaviour.
I have a different opinion about that. This automatic choosing would be one feature in your tool to establish an even more fluid workflow. Most of times when you designed an arc, you put a radius dimension to it. On the other hand, most of times when you designed a circle, you put a diameter dimension to it. Like out of 50 times you just need it one time the other way around (just a guess, i didn't do any statistics about it ;)). So just in this "uncertain" case you would need to use this key to toggle alternatives.
If you would always choose circle or arc depending on based on a settings it would interrupt yourself lot's of time by pressing the alternative toggle key.

One further idea. Would it be possible that the alternatives toggle key would be same between your auto tool and poly line tool? In my naive view, i like shift key even more than the m key... but hey, if it would be m key for both it wouldn't be to bad as well. Still one less key to keep in mind ;)
bleber
Posts: 259
Joined: Thu Jun 30, 2016 5:12 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by bleber »

One dificult case to make radius or diameter constraint of a sketch to make a revolution body. There are not such type of constraint to make a radius or diameter from line.
Attachments
Screenshot_20220121-225210__01__01.jpg
Screenshot_20220121-225210__01__01.jpg (39.02 KiB) Viewed 7352 times
Screenshot_20220121-225019__01__01.jpg
Screenshot_20220121-225019__01__01.jpg (30.32 KiB) Viewed 7352 times
cadcam
Posts: 273
Joined: Thu Apr 02, 2020 10:39 am

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by cadcam »

This looks brilliant and the use of the Shift for radius<->diameter seems reasonable.
Another possibility used in some packages it the number of fast clicks, e.g.
...........Single Click....Double Click
Arc...........radius.........diameter
circle......diameter..........radius

Is something similar possible within the FreeCAD underlying UI?

Thank You
Last edited by cadcam on Sat Jan 22, 2022 3:41 pm, edited 1 time in total.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by drmacro »

The comments about speed and efficiency and fluidity are for some imaginary world where there is no thought during the process, just raw geometry creation as fast as possible.

My designs have never benefited from such a strategy.

To me this implies no real consideration given to the constraint scheme...and thus why so many have sketches that deform unexpectedly. It implies "just constrain until it goes green" strategy (granted, this is taught by a lot of tutorials).

Look, the OP is doing what so many don't do. He sees something he thinks he can improve and has jumped into the code and is doing so. Most just complain about it not being the way they think it should be.

I applaud his effort.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

Im having trouble compiling this branch, first time compiling so perhaps a newbie error.

First, the icon Constraint_Contextual_driven.svg seems to be wrongly named, so i changed it to Constraint_Contextual_Driven.svg.

Second, after 97% compiling i get this:

Code: Select all

[ 97%] Built target TechDrawGui
make: *** [Makefile:130: all] Error 2
Any ideas? Compiling on Ubuntu 20.04 LTS.
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: Sat Jan 22, 2022 11:29 am Im having trouble compiling this branch, first time compiling so perhaps a newbie error.

First, the icon Constraint_Contextual_driven.svg seems to be wrongly named, so i changed it to Constraint_Contextual_Driven.svg.

Second, after 97% compiling i get this:

Code: Select all

[ 97%] Built target TechDrawGui
make: *** [Makefile:130: all] Error 2
Any ideas? Compiling on Ubuntu 20.04 LTS.
Yes you are correct it should be with D not d.

For your build error, it seems related to TechDraw workbench. So I suggest that you try to deactivate it with Cmake.
I have made no modification to techdraw so I don't know why you get this. Sorry I'm not an expert myself of compiling.
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

paddle wrote: Sat Jan 22, 2022 2:11 pm
Haavard wrote: Sat Jan 22, 2022 11:29 am Any ideas? Compiling on Ubuntu 20.04 LTS.
For your build error, it seems related to TechDraw workbench. So I suggest that you try to deactivate it with Cmake.
I have made no modification to techdraw so I don't know why you get this. Sorry I'm not an expert myself of compiling.
Compiling without techdraw (-DBUILD_TECHDRAW=OFF) gives the same error, but now after FEMGui.
I compiled your master just fine.

Am i doing it right?

Code: Select all

git clone https://github.com/PaddleStroke/FreeCAD.git freecad-paddle-source
cd freecad-paddle-source
git checkout ConstraintContextual

then create and open the build folder
cmake ../freecad-paddle-source -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3
make -j 8
Haavard
Posts: 217
Joined: Wed Feb 17, 2021 10:48 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by Haavard »

Disabled compiling for both techdraw and fem, still the same issue :(
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: NEW FEATURE ! Sketcher Constrain Contextually

Post by paddle »

Sorry I'm compiling on windows and I sucks at setting up IDE.

So you can compile my master but not the branch then?
Can you try to compile my other branch https://github.com/PaddleStroke/FreeCAD ... ToolWidget

My constrainContextually branch also have a commit that OpenBrain did for the selection of constraints.
Can you try to compile his PR see if it works ? https://github.com/FreeCAD/FreeCAD/pull/5398
Because his commit is more system wide (I think) than mine. I made modifications only in sketcher, none system wide so I don't see why it would affect.
Post Reply