Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
carlopav
Posts: 290
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun May 05, 2019 9:51 am

Thinking improving the tool with the experiments i did with multi object editing... what about this behaviour?
  • activating Draft Edit from the toolbar;
  • taskpanel shows "Draft Edit mode activated" and the "finish/close" option. Maybe some info on the available keyboard shortcuts;
  • a selection observer is set up, so every selected object is processed and edit trackers are displayed over it (the edit tracker should be improved to remember which object it belong);
  • user can select multiple trackers (maybe with SHIFT+CLICK), and the tool should auto-set editing for every coincident node;
  • the user click the tracker he wants to edit and editing is activated
  • the tool remains active until the user press ESC or click close on the taskpanel, so the selection observer is removed
  • options for every tracker (to edit parameters, change the editing mode, change bezier curve knot continuity) could be displayed with right click on the tracker
User avatar
benjaminwharton
Posts: 46
Joined: Mon Feb 25, 2019 1:03 am

Re: Draft Edit improvements

Postby benjaminwharton » Sun May 05, 2019 9:57 pm

Regarding editing a wire with draft edit, is there any way to snap to another point in the wire? So that for example I can constrain one axis and snap one point to another horizontally or vertically.
carlopav
Posts: 290
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Mon May 06, 2019 5:25 am

benjaminwharton wrote:
Sun May 05, 2019 9:57 pm
is there any way to snap to another point in the wire?
Short answer: no.
Long answer: the tool toggle object selectability off (I guess to prevent selecting and deselecting it when editing points) so ATM it's impossible to snap on the object itself. I experimented in letting it selectable but I had to check and restore the selected state every mouse click, and due to a small lag in the prpcess this didn't look so nice.
User avatar
yorik
Site Admin
Posts: 11552
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft Edit improvements

Postby yorik » Wed May 08, 2019 12:25 am

There are also potential problems with this, if you have a wire that contains two points at the same location, many opencascade operations will fail.
We could workaround this, though, for ex. adding a dummy temporary object, or any other method, but then we also need code to check that there aren't two coincident points next to one another.

Your plan looks good @carlopav! I think the Draft edit tool could definitely become more like the sketcher, with a bit slower workflow, but with additional options.
carlopav
Posts: 290
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun May 19, 2019 8:49 pm

yorik wrote:
Wed May 08, 2019 12:25 am
if you have a wire that contains two points at the same location, many opencascade operations will fail.
Currently there Draft edit checks if this happens before applying transformation. Anyway i'll keep experimenting a bit with it.
I'm experimenting also with the selection observer, but this is taking a bit longer :)

With PR : https://github.com/FreeCAD/FreeCAD/pull/2188 i tried to refactor a bit the whole tool.
Before, everything was carried on inside two methods:
- proceed: did set editpoints
- update: apply the transformation to the object.

I tried to bring the most i could at the end of the class, dividing into "groups" what is supposed to work on the same object type.

In the meantime i discovered some bugs on dimensions that i'll try to correct as soon as i have some more time.

Also I tried to divide methods as much as i can, because i want to add the preview to Draft edit, so point list calculation should be separated from object updating. This will also help with multiple object editing.
At the moment just the bezier curve editing works with the preview, but who ever know what the future will bring. =)

@moult I tried subelement modifiers and it work great, i wonder how to integrate Draft Edit in your "D, E" command that works like a charm :)
User avatar
Moult
Posts: 220
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Postby Moult » Sun May 19, 2019 9:22 pm

Looking forward to seeing the results of your work carlopav, have you got a short video summary showing some of the features?

As for modify subelements, actually it works completely independently of enabling the "Draft edit" (D, E) feature. However, enabling the D,E feature can make it easier to see and select the wires.
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
carlopav
Posts: 290
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun May 19, 2019 9:36 pm

Moult wrote:
Sun May 19, 2019 9:22 pm
Looking forward to seeing the results of your work carlopav, have you got a short video summary showing some of the features?
Me too... I did throw away most of my experiments on a new node editing tool and started again modifying the old one. It a big monster and I'm trying to split it in pieces so maybe they could be used by other tools too. I hope I'm not getting stucked again and to be able to show you something!
carlopav
Posts: 290
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun Aug 18, 2019 2:25 pm

Moult wrote: ping
Hi Moult, I had a bit of time to work again on the old draft Edit. Here is the PR:
https://github.com/FreeCAD/FreeCAD/pull/2430
In brief i used pivy graphics to improve node selection. More have to be done, but I hope this will solve many issues we had.
I also almost completed a general reordering of the code, so now it's a lot easier to extend the tool to new objects, also from other workbenches. Here is an example with part box:
yiNH494fcM.gif
yiNH494fcM.gif (908.32 KiB) Viewed 488 times
Also with the general reordering @Vox will do on the draft code, many functions of the draft edit could go in each object module (this could be the case of the code that handle bezier curve editing, and the code that handle editing arcs). Do you think that Subobject editing via DraftEditImproved could benefit from it? I'm thinking expecially on arc, bezcurve, rectangle, dimensions?
Maybe when we activate the command "DraftEditImproved" we can also place some editpoints on the objects and remove them with ESC?
ABeton
Posts: 39
Joined: Tue Sep 03, 2019 6:39 pm

Re: Draft Edit improvements

Postby ABeton » Fri Oct 04, 2019 10:11 pm

Great work on Draft Edit :D What other ideas did you have in mind for it if any? :)
User avatar
Moult
Posts: 220
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Postby Moult » Fri Oct 04, 2019 11:16 pm

Your work looks absolutely great carlopav! I love it!
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.