martinproks / cosmeticthread3d

FreeCAD tool - cosmetic thread for 3D geometry - experimental
GNU Lesser General Public License v2.1
4 stars 0 forks source link

Undoing threads leaves objects behind #35

Open pierreporte opened 2 months ago

pierreporte commented 2 months ago

How to reproduce:

  1. Create a thread on a part (Part or PartDesign, doesn’t matter).
  2. Undo it (it takes several clicks).
  3. The tree still contain two objects: ThreadOrientation and CosmeticThread3DExternal or CosmeticThread3DInternal.

There should be nothing left in the tree.

ThreadOrientation shouldn’t be in the tree in the first place.

martinproks commented 1 month ago

Hi, Test it please. It should be fixed now - commit #52.

pierreporte commented 1 month ago

The problem still exist but a bit different.

Complete model: image

1st undo: image

2nd undo: image

3rd undo: image

The desired result is achieved by the 3rd undo.

BTW the new implementation with common a Part & PartDesign feature doesn’t put the threads in the Boly container.

martinproks commented 1 month ago

Hi,

Problem 1 - undo. I think this is OK - it is safe solution without hidden side effects. If I change it to one step, there will be another possible risk/issue related to undo system in FreeCAD. The undo is not handling just on one document, but on whole FreeCAD (according to documentation). If I open undo trigger at the begin of the thread command and close it at the end, it will be undo at one step. But there are 2 non modal dialogs (attachment editor and thread UI). User can switch document to other, change something, go back to the document with ct3d and finish thread (dialogs). Less probable, but possible. And when the user hit undo, it will undo all actions in all documents between ct3d start and finish in one undo. Instead of multiple undo steps in multiple documents...

About Part Design. The PartDesign version is suppressed. There is just Part version accessible. Read user manual

pierreporte commented 1 month ago

Got it. It’s a nasty side effect of https://github.com/FreeCAD/FreeCAD/issues/11914.