Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53921
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft Edit improvements

Post by chrisb »

Sorry for being late to the party, there are currently too many posts to follow every single topic.
I just realized that the "AddPoint" and "RemovePoint" buttons which were present in 0.18 have vanished from the Edit dialog. I will not discuss if it was sensible to remove them, but it would be great if the handling was consistent with with other common usage, especially in FreeCAD. A very common way to delete something is to use the dedicated "Del" key. That's the way how it is done in Sketcher, in the tree, and probably in other places too. This is so standard even beyond FreeCAD, that it often doesn't have to be mentioned at all.
Than we have the possibility of selecting one or more things and use a "Remove/Delete" button, that's how it is done e.g. in Path workbench.
Here we have another way of removing something, which is very well hidden compared to the other deletion methods. To improve consistency e.g. with the Sketcher - and editing sketches could be seen as a counterpart to editing wires - it would be great if the delete key would be enabled to remove vertices.
I couldn't find out yet how to add a vertex or line segment, so I cannot well comment on this function - except that this fact is a sort of comment by itself.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Draft Edit improvements

Post by bitacovir »

chrisb wrote: Fri May 22, 2020 10:45 pm Sorry for being late to the party, there are currently too many posts to follow every single topic.
I just realized that the "AddPoint" and "RemovePoint" buttons which were present in 0.18 have vanished from the Edit dialog.
Here an explanation about this... https://forum.freecadweb.org/viewtopic.php?f=23&t=44335
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

chrisb wrote: Fri May 22, 2020 10:45 pm it would be great if the handling was consistent with with other common usage, especially in FreeCAD. A very common way to delete something is to use the dedicated "Del" key.
Hi chrisb, you are not late: I agree that the current behaviour is not so satisfying, also if I find it way better than the previous.
The usage is explained in the command tooltip (DelPoint and AddPoint were removed because multiobject editing was introduced, and there are object where those subcommands are not suitable).

The Del key it's a good suggestion. What is different from sketcher is the selection method. In Draft_Edit you do not select vertexes at the moment, because when you click on them you activate the editing on the clicked tracker. Perhaps we can use the highlighting to delete the highlighted vertex when pressing Del key. Would that be enough? (I have to check I'm able to capture the Del key exclusively with Draft_Edit, because it would be annoying if it also delete the selected object).

What I'm still missing is how to add the Tracker options to the context menu... I'm a real noob and I'm really not able to do that also If i kept trying for a whole year long... (this I think would make clear the interaction options to the user)
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

chrisb wrote: Fri May 22, 2020 10:45 pm A very common way to delete something is to use the dedicated "Del" key.
Here is a little attempt... It works, and it's really intuitive BUT : :oops: if an object is selected, FreeCAD catch the DEL key pressed and delete it... I have to check how the sketcher handle this... Any hints?
iilyN28bur.gif
iilyN28bur.gif (90.81 KiB) Viewed 1338 times
follow my experiments on BIM modelling for architecture design
chrisb
Veteran
Posts: 53921
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft Edit improvements

Post by chrisb »

I cannot really see what happens when a point becomes red, did you click it? That would be ok, only hovering is rather uncommon.
carlopav wrote: Sat May 23, 2020 7:18 am In Draft_Edit you do not select vertexes at the moment, because when you click on them you activate the editing on the clicked tracker.
I wouldn't care if it is in edit mode. If you hit the del key I would delete the vertex.
I see the difficulty to distinguish where the del key should go: The wire, the vertex or if you are in an input field, the typed text.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

chrisb wrote: Sat May 23, 2020 3:32 pm I cannot really see what happens when a point becomes red, did you click it? That would be ok, only hovering is rather uncommon.
It's just hovering.

In Draft_Edit, this is the default editing behaviour:
- Start Editing with a selected object or select one object after launching the command;
- Edit Trackers appears on editable points;
- When you hover a Tracker, it becomes red (its kind of preselection);
- when you click a point you start editing;
- next click will be the destination point of the Tracker displacement.

So, selecting a Tracker and deleting it, it's just not possible at the moment. Even if I would be able to capture exclusively the del key pressed event.
If you are not in Edit Mode the Draft_Edit command is just not active, and none can be done to delete a vertex...

Perhaps I should consider refactoring the whole command again to better integrate looo pivy graphics... :roll:
Last edited by carlopav on Sat May 23, 2020 4:21 pm, edited 1 time in total.
follow my experiments on BIM modelling for architecture design
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Draft Edit improvements

Post by Syres »

carlopav wrote: Sat May 23, 2020 3:51 pm Perhaps I should consider refactoring the whole command again to better integrate looo pivy trackers... :roll:
Before you make radical changes, what about :

Code: Select all

            if key == 65535 and Draft.getType(self.obj) == None:  # "Delete but only if something is not selected"
If we could have Insert key for Add and Delete key for Delete/Remove then I think that would be excellent IMHO

Edit: I've attached my modified gui_edit.py file located in src\Mod\Draft\draftguitools if anyone wants to try it, using the convention Insert key for Add and Delete key for Delete/Remove. Just make sure to test for regressions in other areas that Draft>Edit works, I'm sure it won't take too much work to meet most people's expectations.
Attachments
gui_edit.py
(76.48 KiB) Downloaded 39 times
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

Syres wrote: Sat May 23, 2020 4:08 pm

Code: Select all

            if key == 65535 and Draft.getType(self.obj) == None:  # "Delete but only if something is not selected"
The idea is good, but it will not work. Imagine the usecase where an user have one object selected, he hover the Tracker and press DEL: the object will be deleted (cause we do not have the exclusive ownership of the keyboard events), and the Tacker will not be deleted...

With the refactor of this summer I substituted almost all the interaction code with looo graphics module, but I had to adapt it to work with Snapper. It worked, but I also discarded many other useful features, like the setup of an interaction separator... I guess this is the main problem when editing, because FreeCAD itself does not know that we are in this edit-mode. So I will try this way first or later...
follow my experiments on BIM modelling for architecture design
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Draft Edit improvements

Post by Syres »

carlopav wrote: Sat May 23, 2020 4:25 pm The idea is good, but it will not work.
Yep you're correct, it's not new user proof but I thought that's what Ctrl-Z is for!!!
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

Syres wrote: Sat May 23, 2020 4:58 pm Yep you're correct, it's not new user proof but I thought that's what Ctrl-Z is for!!!
:lol:
follow my experiments on BIM modelling for architecture design
Post Reply