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!
User avatar
esr
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA
Contact:

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

Post by esr »

drmacro wrote: Tue Sep 14, 2021 4:26 pm
esr wrote: Tue Sep 14, 2021 4:07 pm So this is some recently-introduced problem specifically to do with i3, not present in 0.18.

Is this enough evidence for me to file a bug report under local customs?
I suppose, but I doubt FreeCAD can do anything about WM issues. (short of users listing workarounds). It's possible that it is a Qt problem, if that is the case, we wait for the good folks at Qt to find a fix...
Following up...I built from repository head as of last night (1ceaa) and the i3 problem is gone. So that's one bug I won't have to file, and from now on I'll be asking my newbie questions about the development tip version.
User avatar
esr
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA
Contact:

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

Post by esr »

Two requests for people looking at the code for processing angle constraints, for once you've modified it:

1. Either document the new behavior or leave a note explaining it on this thread so I can do it.

2. Please choose a simple rule. I think "always choose the arc less than 180deg" would be best.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

esr wrote:ping
I see that you have added some info to the Sketcher_ConstrainAngle page based on this discussion.
But I cannot reproduce what the paragraph calls the "stable" case.

See image and file:
  1. The left leg of each V was created first.
  2. The directions of the lines vary.
  3. When applying the constraint the order was always: select left leg, right leg and point, and then call the command.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
angle-selection.png
angle-selection.png (12.04 KiB) Viewed 1766 times
angle-selection.FCStd
(5.16 KiB) Downloaded 33 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

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

Post by GeneFC »

Roy_043 wrote: Tue Sep 21, 2021 8:00 am But I cannot reproduce what the paragraph calls the "stable" case.
I agree.

Ironically, if one selects only the two lines (either left or right first) and does not select the common point then the interior angle appears in all cases.

Gene
User avatar
esr
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA
Contact:

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

Post by esr »

I haven't had time to check that the "stable case" doesn't reproduce in the tip verseion, as I needed to do work that pays bills.

I can understand removing the "stable case" description if you didn't see matching behavior, but youy really should have left in a warning that the behavior is undocumented and likely to change. This is going to be a signoificant point of confusion for anyone using angle constraints, and users deserve to know that they're not being dimwitted in failing to grasp what the rules are.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

esr wrote: Fri Sep 24, 2021 9:43 pmbut youy really should have
I have removed the paragraph you have added. We can have a discussion about it, but, bottom line, editors do have to take care that the information they add is accurate. This obviously includes using the latest version of the program.

Please also react to this:
https://forum.freecadweb.org/viewtopic. ... 91#p534791
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

For the record: Repeating my test in V0.18 shows the exact same result.
Attachments
angle-selection-version-018.FCStd
(4.36 KiB) Downloaded 31 times
drmacro
Veteran
Posts: 8869
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

Hmm...just throwing this out, having just experienced it

I was surprised, when in Sketcher, I constrained a 2 degree angle and got 2 degrees rather than 178. In fact, having this thread in mind, even tried to get 178, and couldn't.

But, my goal was to show the 2 degree angle outside the Sketcher (not in TechDraw) for explanatory purposes.

None of the measure tools would allow me to get 2 degrees. Even Manipulator workbench Caliper would only do 178.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

Looking at the OP again, and at some of the answers, there is also some confusion about the meaning of complementary angles (total is 90 degrees) and supplementary angles (total is 180 degrees).

esr wrote: Tue Sep 14, 2021 10:52 am Sometimes it chooses the greater angle (> 180 deg).
This is neither. And I wonder if this ever occurs.

See https://en.wikipedia.org/wiki/Angle
Post Reply