View Issue Details
ID  Project  Category  View Status  Date Submitted  Last Update 

0003434  Sketcher  Bug  public  20180417 00:59  20180531 11:55 
Reporter  AndreKR  Assigned To  abdullah  
Priority  normal  Severity  minor  Reproducibility  always 
Status  closed  Resolution  fixed  
Product Version  0.17  
Target Version  Fixed in Version  0.18  
Summary  0003434: Constraining to external geometry allows for an overconstrained sketch that goes undetected until the external geometry changes  
Description  Steps to reproduce:
It will now show "fully constrained sketch". Now remove the horizontal constraint and add it back: It will now show "Sketch contains redundant constraints". If you take the "fully constrained sketch" from before and you close it and you change the cube that it references, then the sketch will be broken:  
Additional Information  OS: Windows 7 Word size of OS: 64bit Word size of FreeCAD: 64bit Version: 0.17.13509 (Git) Build type: Release Branch: releases/FreeCAD017 Hash: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7 Python version: 2.7.14 Qt version: 4.8.7 Coin version: 4.0.0a OCC version: 7.2.0 Locale: German/Germany (de_DE)  
Tags  No tags attached.  
FreeCAD Information  

Related: https://forum.freecadweb.org/viewtopic.php?f=3&t=28127 

This is a very good example of how the solver works out partially redundant constraints. In fact, if we decide to change how it currently works, this example is a very good discussion point. Thanks for reporting it. Does this behaviour look odd? Yes, it does. Is it a bug in the sense that the program operates contrary to its design decisions? No, it is not. Improvements may come, but currently it is what it was thought it was right to do. Why? Observation 1: If you change the order of the constraints (after reproducing the example above, when it shows redundants, just delete the two coincident constraints, and add them again, causing the horizontal constraint to be the first constraint), the solver notifies a redundancy or it does not. In order to understand what is happening, one has first to understand that the 3 constraints of this sketch (horizontal, coincidence 1, coincidence 2) operate on a line. When this is converted into an equation system at the solver, a line having two points and thus 4 DoF (4 parameters in the following) is being constraint by a horizontal (removes one DoF), a coincidence with a fixed position (removes 2 DoF), a second coincidence (removes 2 DoF), so in total 5 solver constraints (each removing one DoF). For the solver all is an equation system, which has more equations than unknowns (though admittedly, one equation is linearly dependent of the others, otherwise it would not be redundant, but conflicting). It has to be noted that there is not a single one that is dependent on the others, one could say that 1 is dependent on 24, or that 3 is dependent on 12 and 4. The solver does not have a preference (yet), so it just selects as redundant one of them. If we shortly come back to the beginning, 3 sketcher constraints represent 5 solver constraints. So if we rethink the numeric example above, we come to two possibilities, a) the horizontal (solver constraint nr. 1) is the redundant with the two coincident constraints, b) one of the coincidents (solver constraint nr.3) is the redundant with the horizontal and the other coincident, albeit only partly redundant (you could think that if you fully remove the coincident, you have 1 DoF and you can move the point, however if you put the coincident you have a redundancy). The fathers of GCS acknowledged this partly redundancy problem, which arises in more complex cases, in which there is not a simple obvious solution (like in this case), just remove the horizontal. So they decided something in the line of: 1) The solver will tell me one solver constraint is redundant, I will check if the corresponding sketcher constraint introduced more than this solver constraint (like the coincident above), if so, the user can not delete it because he would be deleting in addition something he needs, so we can not ask him to do it, so we will ignore this redundancy for him. 2) However, if the sketcher constraint can be fully removed, then we complain to the user, because he can remove it and if we let him add more and more redundant constraints, and the end the sketch would be very difficult to understand. The case is what the solver identifies as the redundant solver constraint. For this, ATM, the order is important. I will give it a deeper thought, but I wanted to document what is happening first. My current opinion is that this is a "feature request" that needs some deeper thinking. :) 

A branch to test: https://forum.freecadweb.org/viewtopic.php?f=8&t=6617#p229548 

https://github.com/FreeCAD/FreeCAD/commit/03c3539dbfac10e38abc5f7fec8fefb8966d388e 
Date Modified  Username  Field  Change 

20180417 00:59  AndreKR  New Issue  
20180417 01:41  AndreKR  Note Added: 0011165  
20180422 05:32  abdullah  Note Added: 0011176  
20180423 12:37  abdullah  Assigned To  => abdullah 
20180423 12:37  abdullah  Status  new => assigned 
20180423 18:52  abdullah  Note Added: 0011184  
20180531 11:55  wmayer  Status  assigned => closed 
20180531 11:55  wmayer  Resolution  open => fixed 
20180531 11:55  wmayer  Fixed in Version  => 0.18 
20180531 11:55  wmayer  Note Added: 0011325 