Sketcher slow on delete object

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Dex
Posts: 56
Joined: Tue Sep 26, 2017 4:52 pm

Sketcher slow on delete object

Postby Dex » Thu Dec 21, 2017 12:17 pm

I have got a part as on the screen. When I edit a sketch (for example sketch18) the sketcher works slow BUT it only when I delete object (line, point, constraint). After delete I must wait several seconds. It works instantly when I change or create a new object or constraint. I guess the part is recomputed somehow on every deletion but not on other operations.
2017-12-21 13_10_17-FreeCAD.png
2017-12-21 13_10_17-FreeCAD.png (23.43 KiB) Viewed 2454 times
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12847 (Git)
Build type: Release
Branch: master
Hash: 4034851a5d2ed5c93a8ebedbf0ef40dab8700d94
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Polish/Poland (pl_PL)
chrisb
Posts: 16932
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher slow on delete object

Postby chrisb » Thu Dec 21, 2017 8:13 pm

In Sketcher you should uncheck "Auto update". It helps in many but not in all cases, so your problem may persist (I have it myself on large projects). You may additionally try "Skip recomputes" for the whole model.
Dex
Posts: 56
Joined: Tue Sep 26, 2017 4:52 pm

Re: Sketcher slow on delete object

Postby Dex » Fri Dec 22, 2017 7:30 am

A have auto-update disabled but it is not the case. It is indeed the recompute() that is triggered after every delete in sketch:
>>> App.ActiveDocument.Sketch026.delGeometry(12)
>>> App.getDocument("Wentylacja_v4").recompute()

Is it necessary to recompute after each delete in sketch?
and is it safe to disable recompute globally for the model?
chrisb
Posts: 16932
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher slow on delete object

Postby chrisb » Fri Dec 22, 2017 8:38 am

Dex wrote:
Fri Dec 22, 2017 7:30 am
and is it safe to disable recompute globally for the model?
Of course it is not! It can be used to make multiple changes to a feature or object but before you continue, you should of course perform a recompute, be it manual or by returning to automatic.
triplus
Posts: 8457
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher slow on delete object

Postby triplus » Fri Dec 22, 2017 5:40 pm

Hi @Dex.

If "Auto update" option doesn't take delete operations into consideration. That likely would be worth reporting on the issue tracker.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher slow on delete object

Postby abdullah » Sat Dec 23, 2017 10:29 pm

Hi!

I just saw this. Some insight:

1) Deleting at sketch level is slow. It is reported in the issue tracker. (in case you want to delete the whole sketch, there is a command accessible only from the menu that is very fast).

2) If deleting does not delete what it should or deletes what it shouldn't, please report it in the tracker, attaching an sketch an indicating how to reproduce the bug. You can assign it to me.

3) Deleting has a recompute "up in the hierarchy" outside of the sketcher boundaries. I have it identified. I am not sure how to solve this, but it is worth reporting it in the bug tracker. I think it should be possible to delete an element without a recompute, just with a solve.
Dex
Posts: 56
Joined: Tue Sep 26, 2017 4:52 pm

Re: Sketcher slow on delete object

Postby Dex » Mon Dec 25, 2017 9:41 pm

abdullah wrote:
Sat Dec 23, 2017 10:29 pm
1) It is reported in the issue tracker.
3) it is worth reporting it in the bug tracker
So, it's reported or not, because If I'm correct 1 and 3 are the same things :)
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher slow on delete object

Postby abdullah » Thu Dec 28, 2017 10:51 am

Dex wrote:
Mon Dec 25, 2017 9:41 pm
1) It is reported in the issue tracker.
3) it is worth reporting it in the bug tracker

So, it's reported or not, because If I'm correct 1 and 3 are the same things :)
As the post says:
that it is slow when deleting is in the bug tracker.
that it may not delete everything the user asked to delete, or that it deletes other objects not being requestedis not in the bug tracker.

If it does what it promises but it is slow, then there is no need to report anything as we know it is slow and that is in the bug tracker.

If it does not deliver what it promises, then it is definitely a bug and it would be great to have a method to reproduce this bug. If there is a ticket with a method to reproduce the issue, eventually it will get fixed ;)
Dex
Posts: 56
Joined: Tue Sep 26, 2017 4:52 pm

Re: Sketcher slow on delete object

Postby Dex » Sat Dec 30, 2017 6:23 pm

Ad1 & Ad3 - It seems for me that deleting at sketch level is slow because of a recompute "up in the hierarchy".
Ad2 - I haven't notice any other issues with deleting at sketch.
triplus
Posts: 8457
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher slow on delete object

Postby triplus » Sat Dec 30, 2017 6:40 pm

@Dex

In FreeCAD 0.17 you can right click on the document item in the tree view and enable the option Skip recomputes. To see if it helps reducing time while deleting in Sketcher edit mode.
abdullah wrote:
Sat Dec 23, 2017 10:29 pm
I have it identified. I am not sure how to solve this, but it is worth reporting it in the bug tracker. I think it should be possible to delete an element without a recompute, just with a solve.


Just thinking out loud. Any chance you could re-use this new addition in FreeCAD 0.17? If "Auto update" is enabled in sketcher edit mode to in addition use Skip recomputes feature?