Errors in the workbench sketcher

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!
memfis
Posts: 586
Joined: Tue Nov 15, 2016 7:58 pm

Errors in the workbench sketcher

Post by memfis »

Colleagues, there must be a special thread on the forum for this kind of messages - please move the post there.

I'm actively using Sketcher and often find myself in a situation where I create a fairly complicated sketch #1, it has a lot of restrictions and everything seems to go well. I create a body with that sketch, a g-code program, continue working, create another body, etc. And then suddenly after another work day and closing/opening the file I suddenly go back to that sketch #1, see it in the project tree as "ok, no errors". I open it and ...... is a mess. That's it. Now suddenly there are errors in it, the body involving the sketch becomes "bad" = chain reaction. And the errors are delirious. Trying to follow the "solver's" instructions results in the consistent removal of all dimensional constraints.
This is an obvious bug.

In this case there is a rare (for me) situation where there is a fairly simple sketch that does not depend on any other sketch and yet fully demonstrates the problem - I have isolated it in a separate file.

Here we open the file = no errors
Снимок экрана от 2021-12-08 18-32-29.jpg
Снимок экрана от 2021-12-08 18-32-29.jpg (106.86 KiB) Viewed 1355 times
Here we open the sketch for changes = everything crashed
Снимок экрана от 2021-12-08 18-32-38.jpg
Снимок экрана от 2021-12-08 18-32-38.jpg (155.21 KiB) Viewed 1355 times

Version of the program? - Any version, including this one -

OS: Arch Linux (GNOME/gnome-xorg)
Word size of FreeCAD: 64-bit
Version: 0.20.26498 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 1895593)
Hash: 18955931c7f0926a4cd9d2719be5a433b49ae56e
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Russian/Russia (ru_RU)
Attachments
error.FCStd
(14.54 KiB) Downloaded 32 times
Last edited by memfis on Wed Dec 08, 2021 7:10 pm, edited 1 time in total.
user1234
Veteran
Posts: 3336
Joined: Mon Jul 11, 2016 5:08 pm

Re: Errors in the workbench sketcher

Post by user1234 »

memfis wrote: Wed Dec 08, 2021 3:33 pm Version: 0.20.30629 (Git)
What is this for a Version?

The sketch seems to be overconstraint and unnecessary complex.
memfis wrote: Wed Dec 08, 2021 3:33 pm Here we open the file = no errors
You opened the file, but not the sketch with the sketcher, so you cannot see here much.


memfis wrote: Wed Dec 08, 2021 3:33 pm Here we open the sketch for changes = everything crashed
Nothing crashed here, but it is overconstraint. Have you made the file originally with a other FreeCAD version?

Greetings
user1234
memfis
Posts: 586
Joined: Tue Nov 15, 2016 7:58 pm

Re: Errors in the workbench sketcher

Post by memfis »

I mostly use the branch -

OS: Arch Linux (GNOME/gnome-xorg)
Word size of FreeCAD: 64-bit
Version: 0.20.30629 (Git)
Build type: Release
Branch: makepkg
Hash: 4054d775d2e7c61808759b5a5e473af3f7675da8
Python version: 3.9.9
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: Russian/Russia (ru_RU)

+

OS: Arch Linux (GNOME/gnome-xorg)
Word size of FreeCAD: 64-bit
Version: 0.20.26498 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 1895593)
Hash: 18955931c7f0926a4cd9d2719be5a433b49ae56e
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Russian/Russia (ru_RU)


However, this solver error is also reproduced in the current version of Upimage, which I indicated in the first post.

Agree, well let me create a thumbnail in the branch (assembly) that you consider "wrong". Demonstrated all the same behavior - opened file = no complaints. Opened the thumbnail = broken (in the sense of the word = there are complaints about something you have no reason to complain about).
Okay. We take the "reference" build, appimage = it demonstrates the same behavior.
Trying to make sense of the content of the solver's complaints. What is he complaining about? clearly set simple size limitations like diameter 1mm, distance 25mm, etc., which are not tied to anything, do not rest on anything, etc. The solver always shows only one "extra" limitation, after removing which it immediately shows the next one, and also only one limitation. And so on dozens of times - until all explicitly defined constraints with parameters and point matching constraints (possibly others as well) are removed. This is nonsense.
user1234
Veteran
Posts: 3336
Joined: Mon Jul 11, 2016 5:08 pm

Re: Errors in the workbench sketcher

Post by user1234 »

What is this for a version? 0.20.30629

The count in the master branch (the dev branch) is on 0.20.26584, see https://github.com/FreeCAD/FreeCAD/tree/master

Anyway, never mix FreeCAD versions, that can destroy you files.

Greetings
user1234
memfis
Posts: 586
Joined: Tue Nov 15, 2016 7:58 pm

Re: Errors in the workbench sketcher

Post by memfis »

apotheosis - he considers the REFERENCE constraint "conflicting"!!!
Attachments
Снимок экрана от 2021-12-08 22-14-56.jpg
Снимок экрана от 2021-12-08 22-14-56.jpg (202.06 KiB) Viewed 1230 times
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Errors in the workbench sketcher

Post by chrisb »

Moved from Developers forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Errors in the workbench sketcher

Post by chrisb »

user1234 wrote: Wed Dec 08, 2021 7:14 pm Anyway, never mix FreeCAD versions, that can destroy you files.
To be precise: never start editing in the link branch and then continue with master. (You can of course create a model in an older version and continue editing in a newer. In most cases it works even vice versa, but not always.)

What we need to find the bug:
- A preferably simple model created in master, which works ok, i.e. reopening the sketch shows it in the same state.
- a step by step description what to do to get the state you describe.

If you don't achieve this, you can provide the file (created in master!) after the silent change has happened together with a description of your last steps. Perhaps somebody can then find out what may be the cause.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Errors in the workbench sketcher

Post by chrisb »

memfis wrote: Wed Dec 08, 2021 7:17 pm apotheosis - he considers the REFERENCE constraint "conflicting"!!!
That is not really a surprise, and there is indeed some room for improvement: It is a known issue, that if the solver message shows an error and you continue to edit the sketch, then the sketch can get completely out of whack up to a level where you have to remove nearly all constraints.
That's why I recommend to stop any further editing of a sketch as soon as an error is shown and fix the error immediately. I am very glad that in the current version such a state is shown clearly by switching the color to an alerting red.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
memfis
Posts: 586
Joined: Tue Nov 15, 2016 7:58 pm

Re: Errors in the workbench sketcher

Post by memfis »

Colleagues, you are diligently deflecting the question. The essence of the problem = inadequate behavior of the solver, which needs refactoring.


The sub-questions are.
1. There are many FC assemblies. Most of them are branches with upgrades of separate parts, like Path, topo nam..., etc. What a way backward compatibility.... You do require that the doc file must open adequately in at least any Word of at least one major version, don't you?
I closely follow the changes in the GIT branch I use, and I don't recall any solver changes there. The unchangeability of the solver is also proved by the behavior of the main branch.
2. I have clearly demonstrated that there is a problem. The sketch is simple enough - a couple of splines, some circles, some straight segments. The solver (should) implement LOGIC, which is logical and well thought out. In our case, the solver requires removal of those constraints (supposedly we have an overly restricted sketch), which even a half-drunk person (в состоянии умеренного подпития) would not find excessive, unnecessary. The solver's actions are based on mathematics, an algorithm that is obviously doing wrong in this example.

The "way the solver rapes you, give yourself to the solver and do as he asks" option is akin to indulging the demands of terrorists (not even taxpayers). Yes, I am forced to take this path, but the issue is precisely that such a path is wrong and the situation must be corrected.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Errors in the workbench sketcher

Post by Shalmeneser »

If you open a file in an older version or in an other branch, your model can break because the file is now incompatible with the second version/branch.
It' not a solver problem, it's a file problem.
Post Reply