How does FreeCAD choose the direction of angle constraints?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How does FreeCAD choose the direction of angle constraints?

Post by openBrain »

Just a quick reply ATM, I'll carefully read your post later.
chrisb wrote: Wed Sep 15, 2021 10:36 am 3) if one or both lines start at the outer end and selecting both lines and the center yields the complementary angle.
This isn't what I'm observing.
If (only) one line starts at the outer end, I indeed have the complementary angle when center is selected.
But if both line start at the outer ends, selecting center gives me the supplementary angle, i.e. the opposite angle with same value as the inner angle.
User avatar
thomas-neemann
Veteran
Posts: 11919
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: How does FreeCAD choose the direction of angle constraints?

Post by thomas-neemann »

GeneFC wrote: Tue Sep 14, 2021 7:20 pm
drmacro wrote: Tue Sep 14, 2021 7:32 pm

apparently you can mix gtk and qt. it also seems to be possible to run gtk on ms windows and mac os.

then does it make sense to write new functions in freecad in gtk?

if something is revised it will change in gtk?

then qt would run out and in the end the rest could still be changed.

@wmayer @yorik @realthunder

what's your opinion?
Last edited by thomas-neemann on Wed Sep 15, 2021 1:30 pm, edited 1 time in total.
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: How does FreeCAD choose the direction of angle constraints?

Post by chrisb »

openBrain wrote: Wed Sep 15, 2021 11:42 am Just a quick reply ATM, I'll carefully read your post later.
chrisb wrote: Wed Sep 15, 2021 10:36 am 3) if one or both lines start at the outer end and selecting both lines and the center yields the complementary angle.
This isn't what I'm observing.
If (only) one line starts at the outer end, I indeed have the complementary angle when center is selected.
But if both line start at the outer ends, selecting center gives me the supplementary angle, i.e. the opposite angle with same value as the inner angle.
You are right, but I wouldn't distinguish this case, because you can drag the angle's display always to the supplementary angle.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How does FreeCAD choose the direction of angle constraints?

Post by openBrain »

chrisb wrote: Wed Sep 15, 2021 12:48 pm You are right, but I wouldn't distinguish this case, because you can drag the angle's display always to the supplementary angle.
Fair point.
So we have only 2 cases currently :
* If lines starts or ends at the same (common) point, user is stuck with inner angle, being the center selected or not
* If one starts where the other ends, user can vary between inner or complementary angle depending on whether center is selected or not
Am I correct ?
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How does FreeCAD choose the direction of angle constraints?

Post by openBrain »

Sorry chrisb, very fragmented conversation. :|
chrisb wrote: Wed Sep 15, 2021 10:36 am If case two could be changed to work with the complementary angle too, we would have a sound concept and for all of these cases a possibility to per user's choice the inner or the complementary angle. Is it worth writing a feature request?
Please give me just some time to analyse the code. If it's a matter of 2 code lines, I'll do it directly. Otherwise a feature request will be a good idea.
Things are different when the angle between lines is specified which don't have a common center: Then the angle is drawn between the start of one and the end of the other line. It is not possible to specify the complementary angle.
Hmmm... In case of 2 separate lines, I can get the complementary angle by selecting any line endpoint in addition to the lines themselves. :?
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: How does FreeCAD choose the direction of angle constraints?

Post by chrisb »

Sorry no time left. I tested before and think I got the complementary angle if both lines start at their outer ends, but I cannot reproduce now. So You are most probably correct. I will have some time tonight.
And thanks for looking at it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How does FreeCAD choose the direction of angle constraints?

Post by openBrain »

OK, after having a look at the code, it looks like the "ability" to get complementary angle is more a side effect than a real feature. :)
After some testing, I also admit I hardly understand what is the behavior when selecting 2 lines and a vertex that are not already linked to each other by some way...
Probably the best is to re-think it as a whole, define the behavior we want as a new one, then open a feature request. ;)
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: How does FreeCAD choose the direction of angle constraints?

Post by chrisb »

Thanks for looking at it! I will ponder about the issue.
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: How does FreeCAD choose the direction of angle constraints?

Post by abdullah »

openBrain wrote: Wed Sep 15, 2021 2:13 pm OK, after having a look at the code, it looks like the "ability" to get complementary angle is more a side effect than a real feature. :)
After some testing, I also admit I hardly understand what is the behavior when selecting 2 lines and a vertex that are not already linked to each other by some way...
Probably the best is to re-think it as a whole, define the behavior we want as a new one, then open a feature request. ;)
I do not know which combinations produce which angle. If a feature request is done, I may eventually be able to look at the code and see what is exactly happening behind the scenes. Of course, if you have time and want to undertake it, you are more than welcome.

A word on the line, line, vertex. This is the AngleViaPoint kind of Angle constraint (DeepSOIC created it). That very same constraint is also used in many tangency/normal constraints (not all). It has a locking mechanism to prevent flipping (or at least reduce it, I do not remember by heart the internals).
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How does FreeCAD choose the direction of angle constraints?

Post by openBrain »

abdullah wrote: Fri Sep 17, 2021 9:16 pm Of course, if you have time and want to undertake it, you are more than welcome.
Will greatly depends on my spare time at the moment the feature request will be created. :P
Post Reply