Undo in Sketcher creates inconsistent 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!
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Undo in Sketcher creates inconsistent constraints

Postby chrisb » Sat May 16, 2020 10:27 pm

I attach a model where an error occurs when undoing a certain operation:

To reproduce:
- open the file
- edit Sketch
- delete equality constraint 23
Snip macro screenshot-9852ec.png
Snip macro screenshot-9852ec.png (9.63 KiB) Viewed 313 times
- undo

After that undo a tangency at the end of the left outer arm is no longer tangent:
Snip macro screenshot-806f2c.png
Snip macro screenshot-806f2c.png (7.69 KiB) Viewed 313 times
Recomputing the whole document doesn't help
Abdullah wrote:ping
Attachments
undoError.FCstd
(10.25 KiB) Downloaded 11 times
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: Undo in Sketcher creates inconsistent constraints

Postby chrisb » Sat May 16, 2020 10:40 pm

I detected more weird things:
  • If I select the faulty tangency constraint no constraint is selected in the constraints list
  • if I select the faulty tangency constraint and show the corresponding elements only the point is shown
  • if I select the arc above the faulty tangency and show the corresponding constraints, then the tangency is selected
    In the list of the constraints there is no tangency selected, but an additional coincidence55 instead
  • (weirdest:) There is an equality constraint 51 and an equality consrtaint 48 with an expression
  • The previously present expressions are lost
I attach the file in case the previous error cannot be reproduced.

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20943 (Git)
Build type: Release
Branch: master
Hash: ceb23799c76df3ebfa7be4b9fe83bb62de60bc6c
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
Attachments
errorAfterUndo.FCstd
(8.98 KiB) Downloaded 6 times
kisolre
Posts: 2253
Joined: Wed Nov 21, 2018 1:13 pm

Re: Undo in Sketcher creates inconsistent constraints

Postby kisolre » Sun May 17, 2020 5:25 am

FreeCAD version info?
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: Undo in Sketcher creates inconsistent constraints

Postby chrisb » Sun May 17, 2020 6:08 am

kisolre wrote:
Sun May 17, 2020 5:25 am
FreeCAD version info?
Oh, ooh. Just added. I promise to stay perfectly calm for the next ten posts omitting their FreeCAD infos.
Will retry with the most recent.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: Undo in Sketcher creates inconsistent constraints

Postby chrisb » Sun May 17, 2020 8:11 am

Same with current version:

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21093 (Git)
Build type: Release
Branch: master
Hash: 31bb4d84b92bc587bd79912dd15e132713610773
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
Syres
Posts: 704
Joined: Thu Aug 09, 2018 11:14 am

Re: Undo in Sketcher creates inconsistent constraints

Postby Syres » Sun May 17, 2020 9:15 am

chrisb wrote:
Sat May 16, 2020 10:40 pm
I detected more weird things:
  • If I select the faulty tangency constraint no constraint is selected in the constraints list
  • if I select the faulty tangency constraint and show the corresponding elements only the point is shown
  • if I select the arc above the faulty tangency and show the corresponding constraints, then the tangency is selected
    In the list of the constraints there is no tangency selected, but an additional coincidence55 instead
  • (weirdest:) There is an equality constraint 51 and an equality consrtaint 48 with an expression
  • The previously present expressions are lost
Firstly, I could not reproduce the initial Undo bug with either of the two builds below, I also carried out the Validate Sketch afterwards to ensure any errors weren't being 'hidden' and it passed.

Any of the text in your quote above that has not been struck through I can confirm using your ErrorAfterUndo file.

So overall, it's all a bit inconclusive and inconsistent, it'll be interesting to see other feedback on this one.

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21049 (Git)
Build type: Release
Branch: master
Hash: 9c27f1078e5ec516fe882aac1a27f5c6c6174554
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21097 (Git)
Build type: Release
Branch: master
Hash: a5ab09aa0941cc945e59848897b160f8cbfc0831
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: Undo in Sketcher creates inconsistent constraints

Postby chrisb » Sun May 17, 2020 9:34 am

Same on Ubuntu:

OS: Ubuntu 16.04.6 LTS (Unity/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19. (2020/05/16 18:53:00)
Build type: Release
Branch: unknown
Hash: a5ab09aa0941cc945e59848897b160f8cbfc0831
Python version: 3.5.2
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
abdullah
Posts: 3505
Joined: Sun May 04, 2014 3:16 pm

Re: Undo in Sketcher creates inconsistent constraints

Postby abdullah » Sun May 17, 2020 11:22 am

chrisb wrote:
Sat May 16, 2020 10:27 pm
I attach a model where an error occurs when undoing a certain operation:

To reproduce:
- open the file
- edit Sketch
- delete equality constraint 23
- undo

After that undo a tangency at the end of the left outer arm is no longer tangent:
Hi Chris!

I cannot reproduce with:

OS: Ubuntu 18.04.4 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: ceb23799c76df3ebfa7be4b9fe83bb62de60bc6c
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0

So that you see, if I doing something different:
Peek 17-05-2020 13-20.gif
Peek 17-05-2020 13-20.gif (149.19 KiB) Viewed 220 times
abdullah
Posts: 3505
Joined: Sun May 04, 2014 3:16 pm

Re: Undo in Sketcher creates inconsistent constraints

Postby abdullah » Sun May 17, 2020 11:26 am

chrisb wrote:
Sat May 16, 2020 10:40 pm
[*]if I select the faulty tangency constraint and show the corresponding elements only the point is shown
In the Elements widget I see the endpoints of arcs 12 and 13 selected (before and after deleting equality constraint 23).
Screenshot_20200517_132552.png
Screenshot_20200517_132552.png (63.69 KiB) Viewed 216 times
abdullah
Posts: 3505
Joined: Sun May 04, 2014 3:16 pm

Re: Undo in Sketcher creates inconsistent constraints

Postby abdullah » Sun May 17, 2020 11:34 am

chrisb wrote:
Sat May 16, 2020 10:40 pm

if I select the arc above the faulty tangency and show the corresponding constraints, then the tangency is selected
In the list of the constraints there is no tangency selected, but an additional coincidence55 instead
I get Constraints 21, 22, 40 selected. Constraint 22 is the tangency. I do not get coincidence55 selected.
chrisb wrote:
Sat May 16, 2020 10:40 pm
(weirdest:) There is an equality constraint 51 and an equality consrtaint 48 with an expression
I only see expressions in datum angle constraints.