FreeCAD / FreeCAD/FreeCAD

Sketcher: Solver Failures on Scaling Factor Changes

Open
#8,509 22 comments 0 reactions 0 assignees View on GitHub
Help wanted Mod: Sketcher Status: Confirmed Topic: GCS Type: Bug
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 14h
Merged PRs (30d)
203

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Forums discussion

_No response_

### Version

0.21 (Development)

### Full version info

```shell
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31847 (Git)
Build type: Release
Branch: master
Hash: 502ef8c9ba619671b5137833851a7ebbbab24bf0
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: French/Canada (fr_CA)
```

### Subproject(s) affected?

Sketcher

### Issue description

Apologies, this bug report is going to be messy on account of ongoing trial and error when these messages occurred and not noticing them immediately.

Got two different messages saying to report the issue while trying to add Spreadsheet and Expression based scaling to my model:

`Important: the LevenbergMarquardt solver succeeded where the DogLeg solver had failed.`
and
`Important: the SQP solver succeeded where all single subsystem solvers have failed.`

Initially had failed recomputes with little else to go on - the "Report Window" is unfortunately quiet on these things - started suspecting the way my constraints are set might break on a diagonal once it starts using scaled values.

I removed one length constraint on diagonal `18-Line` and replaced it with a vertical one using expression `sqrt(pow(<>.DiagonaleEntreNiveaux; 2) / 2)` instead.

I had inserted rows and renamed aliases along the way and it looked like the rename did not propagate correctly, which broke some constraint references whom were no longer following changes in my scaling factor, instead trying to get the original unscaled value in column `C`.

I tried scaling factors of 0.5 and 2, going back to one with a successful solve in between.

To see my sketch scale I would sometimes need to double-click on a constraint and cancel out of that dialog.

See attached for a version of the file taken while writing this report.

### Anything else?

[T-RV-7.zip](https://github.com/FreeCAD/FreeCAD/files/10752477/T-RV-7.zip)

Edit:
> Also related: https://github.com/FreeCAD/FreeCAD/issues/21553. A different jump likely happens there with the same effect.

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the report with the attached T-RV-7.zip in Sketcher, using scaling factors 0.5, 2, and 1, and observe the solver messages and Report Window. Compare the behavior with related issue 21553; done means the scaling and renamed Spreadsheet/Expression constraint references recompute consistently without solver failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.