Sketcher bug, says is fully constrained when it is not

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!
freecc
Posts: 158
Joined: Wed Feb 21, 2018 4:17 pm

Sketcher bug, says is fully constrained when it is not

Postby freecc » Tue Sep 10, 2019 4:46 pm

A constraint is also removed randomly.

To see the bug apply a horizontal constraint of 8mm on the horizontal line. If it doesn't work directly try moving the horizontal line up and down to see it.

For the random removal, ....I can't recreate it right now, maybe later. It has happend 2 times.
Attachments
bug.FCStd
(3.58 KiB) Downloaded 9 times
freecc
Posts: 158
Joined: Wed Feb 21, 2018 4:17 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby freecc » Tue Sep 10, 2019 4:52 pm

the random removal is something like this:

move the vertical lines back and forth a little bit as you wish, then apply a 8mm horizontal constraint to the horizontal line. Now drag the horizontal line up and down with one of the vertical lines. The horizontal constraint disappears.
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby kisolre » Tue Sep 10, 2019 4:59 pm

With the speed things are progressing you should really include full version info with such posts...
Also a screenshot in the buggy state would help. I tried an here sketch shows as underconstrained with 2 DOF.
.
Bug_sketcher_2dof.JPG
Bug_sketcher_2dof.JPG (79.38 KiB) Viewed 236 times
.
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17505 (Git)
Build type: Release
Branch: master
Hash: 755536e9df94d2d39da1468420f1fd333c35da7a
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
freecc
Posts: 158
Joined: Wed Feb 21, 2018 4:17 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby freecc » Tue Sep 10, 2019 5:07 pm

kisolre wrote:
Tue Sep 10, 2019 4:59 pm
With the speed things are progressing you should really include full version info with such posts...
Also a screenshot in the buggy state would help. I tried an here sketch shows as underconstrained with 2 DOF.
.
Bug_sketcher_2dof.JPG
.
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17505 (Git)
Build type: Release
Branch: master
Hash: 755536e9df94d2d39da1468420f1fd333c35da7a
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)

To see the bug apply a horizontal constraint of 8mm on the horizontal line. If it doesn't work directly try moving the horizontal line up and down to see it.
Roy_043
Posts: 535
Joined: Thu Dec 27, 2018 12:28 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby Roy_043 » Tue Sep 10, 2019 6:14 pm

Yes, confirmed.

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18024 (Git)
Build type: Release
Branch: master
Hash: 9cc8f6eb666b0a0ae2dc256f7bc0beb8c987710c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
openBrain
Posts: 2353
Joined: Fri Nov 09, 2018 5:38 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby openBrain » Tue Sep 10, 2019 6:20 pm

I guess this is another event of issue #3976 despite end effect isn't exactly the same. ;)
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby kisolre » Tue Sep 10, 2019 6:31 pm

Sorry, I was too quick :) I can confirm that behavior. Also the removal of horizontal constraint OR sketch becomes fully constrained.
I tried with
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Bulgarian/Bulgaria (bg_BG)
and see the same. But only if symmetry is present. If I substitute it with horizontal between arc ends (which because of coincidence of arc center with origin is the same) all works as expected. Probably some rounding error because of the resulting tangency (border condition) and symmetry that has some of its internal DOF removed.

crossposted with openBrain. Looks the same as the bug he posted.
User avatar
bejant
Posts: 5950
Joined: Thu Jul 11, 2013 3:06 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby bejant » Tue Sep 10, 2019 6:45 pm

Edited to reflect the following tickets:
issue #3791 (Solver fails to find redundancy, in orange)
issue #4032 (Solver falsely claims Sketch to be fully constrained, in green)

Note: for Advanced Solver Control I was using DogLeg Solver for both the default Solver and Advanced Solver
=========


I'm wondering how the Sketch was created, because when I open the file the Status Bar message reads:
Touched (but must be executed), Internal name: Sketch"

I can apply the 8 mm Horizontal Distance Constraint to the horizontal line segment and the Sketch mistakenly becomes Fully Constrained.

Even after doing that, I can apply a Tangency Constraint between the arc and either vertical line segment and the Sketch mistakenly becomes Fully Constrained.

After applying a similar Tangency Constraint to the other side, the Vertical Constraint on the line segment onto which the Tangency Constraint was just applied becomes Redundant and the Solver Message instructs me to delete it.

After deleting the Vertical Constraint I have 1 DOF remaining, but the 8 mm Horizontal Constraint still isn't flagged as Redundant until I click the "(click to select)" hyperlink in the Solver Message.

After doing so, Sketcher notices that the 8 mm Horizontal Distance Constraint is Redundant.

If I try to recreate the Sketch from scratch I don't get the errors, but I'm probably not exactly duplicating the procedure.

OS: Ubuntu 18.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19. (dated 2019-08-21)
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Last edited by bejant on Wed Sep 11, 2019 3:51 pm, edited 1 time in total.
User avatar
bejant
Posts: 5950
Joined: Thu Jul 11, 2013 3:06 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby bejant » Tue Sep 10, 2019 6:51 pm

freecc wrote:
Tue Sep 10, 2019 4:52 pm
The horizontal constraint disappears.
Do you have "Auto remove redundants" ticked to On?
freecc
Posts: 158
Joined: Wed Feb 21, 2018 4:17 pm

Re: Sketcher bug, says is fully constrained when it is not

Postby freecc » Tue Sep 10, 2019 6:58 pm

bejant wrote:
Tue Sep 10, 2019 6:51 pm
freecc wrote:
Tue Sep 10, 2019 4:52 pm
The horizontal constraint disappears.
Do you have "Auto remove redundants" ticked to On?
yes