Bug in DogLeg and feature request.

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
danidr
Posts: 32
Joined: Thu Aug 25, 2016 10:46 am

Bug in DogLeg and feature request.

Postby danidr » Tue Dec 19, 2017 9:08 am

Hello everyone,
I am creating a (not-so complex) sketch for an internal project in my company, which also includes expressions linked to a spreadsheet.
The standard DogLeg solver apparently isn't able to solve the sketch when changing the parametrized dimension on first attempt, but I have to force a second recompute to let it solve correctly.

I am attaching the drawing to give you an idea.
Try changing the Variables.Stroke to something like 30mm and you'll notice that the two bodies are not updated correctly on first try. Console reports:
Sketcher::Solve()-DogLeg- Failed!! Falling back...
Important: the LevenbergMarquardt solver succeeded where the DogLeg solver had failed.
If you see this message please report a way of reproducing this result at
http://www.freecadweb.org/tracker/main_page.php

Recomputing the document manually with "Mark to recompute" and the Refresh button fixes it, but on a much larger file as the one I'm working on, this requires too much time, and for our use of FreeCAD, speed is critical.

This brings us to the second point: is it possible to force FreeCAD to use LevenbergMarquardt on recompute instead of just allowing DogLeg, which is currently bugged? I guess this would be easier and quicker to implement than fixing what ever is going wrong in DogLeg.

Link to tracker ticket is: https://freecadweb.org/tracker/view.php?id=3286
User avatar
bejant
Posts: 5812
Joined: Thu Jul 11, 2013 3:06 pm

Re: Bug in DogLeg and feature request.

Postby bejant » Wed Dec 20, 2017 12:52 pm

danidr wrote:
Tue Dec 19, 2017 9:08 am
is it possible to force FreeCAD to use LevenbergMarquardt on recompute instead of just allowing DogLeg, which is currently bugged?
Sure. Edit > Preferences > Sketcher (icon in left pane) > Sketcher Solver (all the way at the bottom) and tick "Show Advanced Solver ..." to True.

(If the Sketcher icon doesn't appear in the left pane you might have to switch to either the Sketcher or Part Design WB first.)

Now when you open a Sketch you can specify which solver to use in the Advanced Solver Control section of the Tasks Tab - you'll see it just below the Solver Messages widget when the Sketch is open in Sketcher.


OS: Ubuntu 16.04.3 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.12772 (Git)
Build type: None
Branch: master
Hash: c8c9b76f43d2c78c4afb65b756f3f07d626aac85
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
UR_
Posts: 945
Joined: Tue Jan 03, 2017 8:42 pm

Re: Bug in DogLeg and feature request.

Postby UR_ » Wed Dec 20, 2017 7:23 pm

If you wouldn't open these sketches, you can preselect solver by [Tools]->[Edit parameters]

Tools- Edit parameters.png
Tools- Edit parameters.png (18.89 KiB) Viewed 529 times
User avatar
Kunda1
Posts: 5232
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug in DogLeg and feature request.

Postby Kunda1 » Sun Dec 24, 2017 1:06 pm

Should I keep issue #3286 open or close as a dupe ? (There are many "LevenbergMarquardt" open ATM)
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
danidr
Posts: 32
Joined: Thu Aug 25, 2016 10:46 am

Re: Bug in DogLeg and feature request.

Postby danidr » Tue Jan 02, 2018 1:11 pm

UR_ wrote:
Wed Dec 20, 2017 7:23 pm
If you wouldn't open these sketches, you can preselect solver by [Tools]->[Edit parameters]


Tools- Edit parameters.png
Thank you for your input. But this is something I have tried already; it will not work on a global document recompute. It will still force the sketch solver to work with DogLeg.