View Issue Details

IDProjectCategoryView StatusLast Update
0002281SketcherBugpublic2015-10-22 22:27
Reportertriplus Assigned Toabdullah  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version14.04
Fixed in Version0.16 
Summary0002281: Tangent and coincident constraint on 2 lines cause issues
DescriptionWhen adding tangent constraint by selecting 2 lines and after adding additional coincident constraint to the line end points sketcher starts to misbehave.
Steps To Reproduce- Add two lines
- Select them and add tangent constraint
- Add coincident constraint between end points and observe the result (try to move line)
Additional Informationhttp://forum.freecadweb.org/viewtopic.php?f=10&t=12599
TagsSolver
FreeCAD Information

Activities

abdullah

2015-10-06 12:09

manager   ~0006481


The problem is with redundant constraint detection in QR decomposition. With the default 1E-13 pivot threshold, it results in the described behaviour. Parameters 8, constraints 4, rank=4.

If the default threshold is changed to 1E-15, then the rank of the QR matrix is reported as 3 (the reality, as the coincidence only reduced one DoF, as the other is determined by the tangency).

This ticket remains open and tagged with "solver", so as to further develop solvers (it would make a beautiful unit test).

abdullah

2015-10-06 12:29

manager   ~0006482

Additional information:

Funny enough, without changing the threshold to 1E-15 (this is with the threshold at 1E-13), if you click "solve" in the advanced solver dialog, then the setupSketch reevaluates the redundancy to a correct rank=3 and it can be moved.

abdullah

2015-10-07 12:59

manager   ~0006486

The problem arises because the geometry moved as a consequence of the solve after the initial solution was calculated. So the initial solution is no longer valid and generates problems when it is partially redundant.

It is not the "full story", as it does not explain why using 1E-15 as threshold did the trick directly.

Nevertheless, the fix solves the issue:
https://github.com/abdullahtahiriyo/Fre ... issue_2281

Maybe somebody smarter than me can be figure out why.

Related Changesets

FreeCAD: master e1dd86f0

2015-10-07 14:33:54

abdullah


Committer: wmayer Details Diff
Sketcher: Bug fix: unable to move geometry after addition of a constraint

=========================================================================

This fixes issue:
http://www.freecadweb.org/tracker/view.php?id=2281

Discussed in:
http://forum.freecadweb.org/viewtopic.php?p=101910#p101910

How to reproduce?
With Auto-Update mode unchecked, execute the sequence in the bug tracker. You will reach to a geometry assembly successfully solved that can not be moved.

Why?
The coincident constraint is partially redundant within the meaning of redundancy of the solver.
The solve within "addconstraint" in SketchObjectPy.cpp causes the geometry to move to meet the coincident constraint.
At the end of the solve, the initial solution used in diagnostics is no longer valid (the geometry moved). This causes a subsequente move not to be executed.

The Solution:
Recalculate just the initial solution after the addition.
Affected Issues
0002281
mod - src/Mod/Sketcher/App/SketchObject.cpp Diff File
mod - src/Mod/Sketcher/App/SketchObject.h Diff File
mod - src/Mod/Sketcher/App/SketchObjectPyImp.cpp Diff File

Issue History

Date Modified Username Field Change
2015-09-26 21:16 triplus New Issue
2015-09-27 09:10 abdullah Assigned To => abdullah
2015-09-27 09:10 abdullah Status new => assigned
2015-10-06 12:05 abdullah Tag Attached: Solver
2015-10-06 12:09 abdullah Note Added: 0006481
2015-10-06 12:09 abdullah Status assigned => confirmed
2015-10-06 12:29 abdullah Note Added: 0006482
2015-10-07 12:59 abdullah Note Added: 0006486
2015-10-07 12:59 abdullah Status confirmed => closed
2015-10-07 12:59 abdullah Resolution open => fixed
2015-10-07 12:59 abdullah Fixed in Version => 0.16
2015-10-22 22:27 wmayer Changeset attached => FreeCAD Master master e1dd86f0