[Closed] Bug 3545: Freeze on "Create New Sketch"

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!
Post Reply
chrisb
Veteran
Posts: 53285
Joined: Tue Mar 17, 2015 9:14 am

[Closed] Bug 3545: Freeze on "Create New Sketch"

Post by chrisb »

This is a comprehension from issue #3545, file attached in the bug tracker.
I might add that, of course, this discussion should have taken place before creating a ticket.
waldschrat wrote: FreeCad freezes in a busy loop (full CPU load) when trying to create a sketch on the "Bottom" body in attached file.

Oddly enough, it is no problem to create a new sketch on the "Top" body.
Also, the problem can be "solved" by deleting the "Top" body out of the file before trying to create the sketch. So it seems the problem appears to be somewhere in the link between the two bodies.
Steps to reproduce:
Open FreeCad
Open attached file
Select "Top" body in Combo View
Press space to hide body
Select "Bottom" body in Combo View
Press space to show body
Right click "Bottom" body in Combo View
Select "Toggle Active Body"
Click any face in 3D view, e.g. main bottom plate
Click "Create New Sketch"
Wait
Wait some more
CPU fan speeds up
Wait even more
Kill FreeCad, because nothing happens
Interestingly, the problem can be "solved" by deleting the "Pad025" entry from the "Bottom" body. Remaking this pad (from Sketch059, 6mm, reversed) also restores the issue.
I don't know what's so special about that pad (or the sketch), but somehow it breaks things.
NormandC wrote: Trying to recompute the whole document makes FreeCAD use 100% of a CPU for minutes with no end in sight. Tools --> Dependency graph generates a blank page. Obviously there is a problem with the file.

Deleting Pad025 (which is located inside "Top" rather than "Bottom") does not solve the FreeCAD hanging issue on recomputing the whole document.

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14727 (Git)
Build type: Release
Branch: master
Hash: c6df59969bfb3ae2027e2b47ddd559852f6e9a4e
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Canada (fr_CA)
abdullah wrote: There are two sketches with problems:


Sketch with redundant constraints
Please remove the following redundant constraint:
5

Over-constrained sketch
Please remove at least one of the following constraints:
3, 4, 8, 9, 10



It is not just that a new sketch can not be created but if you mark the "Bottom" body for recompute and trigger an App.ActiveDocument.recompute(), it also hangs.
Sketch52 has a redundant constraint.
Sketch57 has a redundant constraint.
Sketch58 has conflicting constraints after removing the redundants of sketches 52 and 57.

It is well possible that these were undetected with v0.17.
It is interesting that as the OP indicates, deleting Pad025 allows to continue the design. What is special about Pad025?

IMO not much. It is a sketch attached to a plane with two external links:
a) to shapebinder014.Edge166
b) to Pad024.Edge118

Pad024 is build on top of Sketch058, which is the one getting the conflicting constraints when deleting the redundant constraints.

I will ask the experts to take a look:
1. Mark the document to skip recomputes.
2. Edit Sketch052 with v0.18 remove the redundant.
3. Edit Sketch057 with v0.18 remove the redundant.

[If at this point Sketch058 is opened it appears fully solved, but if a recompute is triggered at this point it hangs].

4. Delete pad025
5. Recompute the document. Sketch058 has conflicting constraints (you may need to click AutoUpdate button to see it as conflicting constraints).

[Not hanging at this point]

6. Delete Sketch058 and Sketch059

7. Trigger a full-document recompute it will go thru, but it will show an error in feature Pocket009 which is made using Sketch052 (the result has multiple solids).

[At this point Sketch052 may not be edited anymore. Before, Sketch052 had 7 external references to Shapebinder014, and a much different shape]

I am not sure to which extend the use of the v0.17 sketcher contributed to all this problems and to which extend one could still run into these problems with v0.18...
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53285
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug 3545: Freeze on "Create New Sketch"

Post by chrisb »

The dependecy graph shows lots of red arrows indicating problems. They go e.g. to Sensor or Controler, which claim to be (or have been) bodies. Perhaps something got out of whack when creating simple copies from bodies? They indicate links going out of allowed scope.

I can delete the whole Top body without breaking references. After that I can easily create a sketch on a face of Body.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53285
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug 3545: Freeze on "Create New Sketch"

Post by chrisb »

After deleteing Top I can recompute the document. I then get the following issues:
Sketch001: redundant constraints
Sketch017: redundant constraints
Sketch019: redundant constraints
Sketch023: redundant constraints
Sketch029: redundant constraints, it has 12 DOF
Sketch030: redundant constraints, it has 7 DOF
Sketch033: redundant constraints, it has 10 DOF
Sketch035: redundant constraints
Sketch039: redundant constraints
Sketch040: redundant constraints
Sketch043: redundant constraints

BTW: It would be great if errors in sketches could be propagated up the tree, i.e. if a sketch contains an error, so should the enclosing feature, the enclosing body, ... . This is even more important for Part WB objects with their deep nesting.

The red arrows in the dependency graph are links going out of allowed scope. With all these I think it is not sensible to investigate this any further, nor do I think it is worth an error report in its current state.

I would recommend to fix the issues in Bottom by creating proper references using ShapeBinders and then rebuild Top by only reusing the sketches, all in 0.18 with its improved checking capabilities. If the issue persists we can investigate it further.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Bug 3545: Freeze on "Create New Sketch"

Post by abdullah »

chrisb wrote: Wed Dec 19, 2018 7:17 pm I would recommend to fix the issues in Bottom by creating proper references using ShapeBinders and then rebuild Top by only reusing the sketches, all in 0.18 with its improved checking capabilities. If the issue persists we can investigate it further.
Thank you Chris for your work.

This really shows the importance of posting the issues first in the help forum. The OP would have got in-time help that might have saved his model and precious time and if problems persisted, then we would have gotten a debug ready example...
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug 3545: Freeze on "Create New Sketch"

Post by Kunda1 »

chrisb wrote: Wed Dec 19, 2018 7:17 pm
BTW: It would be great if errors in sketches could be propagated up the tree, i.e. if a sketch contains an error, so should the enclosing feature, the enclosing body, ... . This is even more important for Part WB objects with their deep nesting.

The red arrows in the dependency graph are links going out of allowed scope. With all these I think it is not sensible to investigate this any further, nor do I think it is worth an error report in its current state.

I would recommend to fix the issues in Bottom by creating proper references using ShapeBinders and then rebuild Top by only reusing the sketches, all in 0.18 with its improved checking capabilities. If the issue persists we can investigate it further.
Should we close issue #3545 and open a FR for 'errors in sketches could be propogated up the tree'?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
chrisb
Veteran
Posts: 53285
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug 3545: Freeze on "Create New Sketch"

Post by chrisb »

Kunda1 wrote: Sat Jan 05, 2019 12:01 pm Should we close issue #3545...
definitely!
... and open a FR for 'errors in sketches could be propogated up the tree'?
yes please. Will you create it?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug 3545: Freeze on "Create New Sketch"

Post by Kunda1 »

chrisb wrote: Sat Jan 05, 2019 1:07 pm
Kunda1 wrote: Sat Jan 05, 2019 12:01 pm Should we close issue #3545...
definitely!
Done and done
New FR is issue #3760 :wink:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
chrisb
Veteran
Posts: 53285
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug 3545: Freeze on "Create New Sketch"

Post by chrisb »

Thanks and thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug 3545: Freeze on "Create New Sketch"

Post by Kunda1 »

chrisb wrote: Sat Jan 05, 2019 1:47 pm Thanks and thanks!
:wink:
BTW, care to mark this thread [Closed] ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply