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!
Post Reply
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

Moult wrote: Sun Feb 24, 2019 2:59 am Hey @carlopav, maybe it's a good time to discuss how we both envision draft editing :)
Yup! happy to read :)

There are essentially two types of draft objects: graph objects (lines / wires) and parametric objects (arcs / circles / splines, etc). graph objects have subelements (vertices / edges), and parametric objects have editing points (arc handle / circle centroid / etc). This distinction is important because subelements are always visible, but editing points are generally invisible unless the current draft edit mode is activated.
[*]Because subelements are always visible, at any time, any combination of zero or more subelements can then be selected and you can perform transformation modifiers (move / rotate / scale / fillet, align, etc) without the need to create or join new draft objects. This is achieved via a "subelement" mode in those respective modifiers. This is already implemented in my PR for the "move" modifier. I can continue working on this to implement subelement mode for all other transformation modifiers
So this will be the 1st way to edit sub elements: i think this works great. Could we create a toggle button in the modifiers toolbar (to put it in the first place) or in the statusbar that set all the modifiers to work on the whole object or on subobjects? I'm afraid that could be bothering (as the move/copy is to me) to have one modifier set to subobjects and the other to whole element, and i think i'd prefer a single toggle for everything keeping every modifier consistent. anyway it's a future problem, what's your idea?
[*]Also at any time, any combination of zero or more subelements can then be selected and you can perform non-transformation modifiers (copy / array / mirror / etc) in a "subelement" mode, but it will result in brand new draft objects for each non-connected graph of 2 or more vertices. This subelement mode covers the majority of usecases around manipulating graph objects. I can build this, seeing as it's part of the whole subelement mode thing.
This is really interesting.
I'd like to point out one thing that i'd like to achieve:
a.JPG
a.JPG (29.02 KiB) Viewed 2264 times
If we are in this condition (and we are every time we have to deal with big 2d imported drawings), i'd like to be able to double click the name "L1 arch" in the tree and perform every draft command inside that shape: creating new edges (subelements), perform transformation modifiers, and perform non transformation modifiers. This would be very useful to me. Expecially if everything is carried out without changing the display mode of objects (for example i'd prefer every object outside the one i'm editing is turned tu pale gray). I'd like to have your comments on that point (expecially if it's negative). :)

[*
]Because of this subelement mode, the stretch tool can be deleted.
Agree
[*]The existing draft edit mode can stay with all of its current functionality + improvements by @carlopav. That is because its primary purpose will now be in modifying editing points for parametric objects.
Agree, it's my main purpouse. Last gifs were based on wires just to keep it simple.
Admittedly, there is a slight double up with the ability to move vertices in the draft edit mode, and the ability to move it using the move command + subelement mode, but that's OK :) Maybe it can be renamed to be more specific to help users understand, to something like draft node mode. @carlopav has already been doing great work in improving this! He should continue!
What i'd like to achieve it's to turn it in a "non command" (more "drag and drop" that is possible) that could be enabled or disabled by a status bar toggle button for exhample. A very lightweight code that puts editpoints when an object is selected and remove them when the object is unselected. A second part of the tool that is activated only if an editpoint is clicked, displaying custom modes to edit the object based on that editpoint.
Also we could set a maximum number of editpoints like "other softwares" do.
[*]When working in a complex scene, draft bases and draft elements may be invisible, obscured, or otherwise hard to select. A new draft highlight mode can be activated which finds and shows all draft elements, including invisible component bases (see https://peertube.social/videos/watch/86 ... e332e916f4). This visibility as well as the improved cycle selection should improve the ability to select these draft objects to get ready to manipulate them. This feature is already done in the PR, just needs more testing and maturity
If i understand that should be the real new edit mode, the one we should activate with "D, E" (or just "E" ?). Great.

Once all that is done, I think I will be happy with all of the draft editing functionality in FreeCAD :)
Me too! I hope i'm able to bring it to the end since i'm a quite weak developer.
follow my experiments on BIM modelling for architecture design
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Post by Moult »

carlopav wrote: Sun Feb 24, 2019 9:55 am Could we create a toggle button in the modifiers toolbar (to put it in the first place) or in the statusbar that set all the modifiers to work on the whole object or on subobjects? I'm afraid that could be bothering (as the move/copy is to me) to have one modifier set to subobjects and the other to whole element, and i think i'd prefer a single toggle for everything keeping every modifier consistent. anyway it's a future problem, what's your idea?
One option is that once you enable "subelement mode", it essentially turns it on by default for all future operations, until you toggle it off. That way you don't need a new interface button, but still acts as a "toggle". If you agree with this, I will include it in my PR :)
carlopav wrote: Sun Feb 24, 2019 9:55 am If we are in this condition (and we are every time we have to deal with big 2d imported drawings), i'd like to be able to double click the name "L1 arch" in the tree and perform every draft command inside that shape: creating new edges (subelements), perform transformation modifiers, and perform non transformation modifiers. This would be very useful to me. Expecially if everything is carried out without changing the display mode of objects (for example i'd prefer every object outside the one i'm editing is turned tu pale gray). I'd like to have your comments on that point (expecially if it's negative). :)
I think this is a good idea, but I haven't run into this limitation just yet, because I haven't been importing 2D drawings. However, it deals with a different type of object. So that we can get some stabilised code, how about we both ignore this one for now, wait until both of our PRs have finished and are merged in master, and then we can tackle this one?
carlopav wrote: Sun Feb 24, 2019 9:55 am
Because of this subelement mode, the stretch tool can be deleted.
Agree
Sounds good. Once both our PRs have stabilised and merged, I will create a PR to delete the stretch tool.
carlopav wrote: Sun Feb 24, 2019 9:55 amWhat i'd like to achieve it's to turn it in a "non command" (more "drag and drop" that is possible) that could be enabled or disabled by a status bar toggle button for exhample. A very lightweight code that puts editpoints when an object is selected and remove them when the object is unselected. A second part of the tool that is activated only if an editpoint is clicked, displaying custom modes to edit the object based on that editpoint.
Given that I disagree with setting it on selection, and I see limitations with double clicking to enable this "node edit" mode, how about this proposal:

1. Rename the existing draft edit mode tool into "node edit" mode tool.
2. To activate the "node edit" tool, activate it via pressing the button or hotkey just like it is now (maybe add a hotkey "N, E"?)
3. Once it is activated, it _stays_ activated. So any future objects you select will automatically show the edit points, just like in your demo
4. When you press escape, it toggles the mode off, and all edit points disappear

This way, it prevents the onselection lag I was afraid off, but it achieves the toggle and onselection behaviour that you like. If you agree with this approach, it would be good if you could implement it in your PR, because if I implemented it, it could raise merge conflicts.
carlopav wrote: Sun Feb 24, 2019 9:55 am If i understand that should be the real new edit mode, the one we should activate with "D, E" (or just "E" ?). Great.
Nah, after rethinking and realising that graph object subelements are always visible, I don't think we need a new draft edit mode. Instead I propose:

1. Rename my "draft edit" mode into "draft select" mode. The purpose is simply to select draft objects, after all.
2. Just like the "node edit" proposal above, it is activated via pressing button or hotkey "D, S", say.
3. Once it is activated, it says activated and you can do various operations on the wires
4. When you press escape, it toggles the mode off, and all the selection highlights disappear

If this sounds good to you, I will include it in my PR.
carlopav wrote: Sun Feb 24, 2019 9:55 am Me too! I hope i'm able to bring it to the end since i'm a quite weak developer.
Yeah, let's aim to wrap both the PRs up and merge sooner rather than later, to prevent merge conflicts, and so that we can both try the latest merged master and play with the new workflows and judge it :) Let me know what you think, and then we can put together a TODO list for both of our PRs so that both can be merged.
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

One option is that once you enable "subelement mode", it essentially turns it on by default for all future operations, until you toggle it off. That way you don't need a new interface button, but still acts as a "toggle". If you agree with this, I will include it in my PR :)
+1.
I think this is a good idea, but I haven't run into this limitation just yet, because I haven't been importing 2D drawings. However, it deals with a different type of object. So that we can get some stabilised code, how about we both ignore this one for now, wait until both of our PRs have finished and are merged in master, and then we can tackle this one?
+1. Yes, it seems to be a problem for performances to have many objects in the tree (https://forum.freecadweb.org/viewtopic.php?t=10337). And it shows up with (let's say) importing also a simple apartment floor plan in dxf (at least on my laptop), if you import every line as an object. If instead it's a single shape FreeCAD can handle very big quantity of subelements without any problem. Good to proceed before finishing this task!
Sounds good. Once both our PRs have stabilised and merged, I will create a PR to delete the stretch tool.
I'm quite new to freecad, started less or more like you at the beginning of 2019. Since there could be people who like it maybe we need to wait for their feedback or just leave a coexistence period to let people appreciate the new mode. ;)
Given that I disagree with setting it on selection, and I see limitations with double clicking to enable this "node edit" mode, how about this proposal:

1. Rename the existing draft edit mode tool into "node edit" mode tool.
2. To activate the "node edit" tool, activate it via pressing the button or hotkey just like it is now (maybe add a hotkey "N, E"?)
3. Once it is activated, it _stays_ activated. So any future objects you select will automatically show the edit points, just like in your demo
4. When you press escape, it toggles the mode off, and all edit points disappear

This way, it prevents the onselection lag I was afraid off, but it achieves the toggle and onselection behaviour that you like. If you agree with this approach, it would be good if you could implement it in your PR, because if I implemented it, it could raise merge conflicts.
We can for sure proceed like this, since I agree double clicking to be reserved for selection purpouse. Anyway in the last refactoring the showing up of editpoints didnt cause any lag at all in the selection procedure, and i'd like to limit the maximum ammount of points to show up. I'd prefer the status bar toggle button solution to enable/disable the mode, but i think we can postpone this decision to when i'll be ready with at least a working prototype of the tool :)
carlopav wrote: Sun Feb 24, 2019 9:55 am If i understand that should be the real new edit mode, the one we should activate with "D, E" (or just "E" ?). Great.
Nah, after rethinking and realising that graph object subelements are always visible, I don't think we need a new draft edit mode. Instead I propose:
I'm a bit confused :? Trying to recap the purpouse for editing modes:
- The first is displayed just as an option in the standard transformation and non transformation modifiers (called something like "subelement E(d)iting")
- The second is the Draft Select mode that higlight all the hidden subelement geometry and sets the modifiers to work on subelements (if it's like this, we can continue to call it "D, E". "D, S" if you prefer).
- The third is the node Edit (Toggled by "N, E" or a status bar button).
Did I get it?
Yeah, let's aim to wrap both the PRs up and merge sooner rather than later, to prevent merge conflicts, and so that we can both try the latest merged master and play with the new workflows and judge it :) Let me know what you think, and then we can put together a TODO list for both of our PRs so that both can be merged.
+1
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 »

Good to proceed before finishing this task!
I meant after :)
follow my experiments on BIM modelling for architecture design
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Draft Edit improvements

Post by paullee »

Not following in detail.. so also a little bit confused about 'Draft Edit' 'Draft Modifiers' :D

ScreenCaptures look terrific though :lol:
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: Draft Edit improvements

Post by regis »

paullee wrote: Sun Feb 24, 2019 6:33 pm Not following in detail.. so also a little bit confused about 'Draft Edit' 'Draft Modifiers'
hehe also trying to hang in there
paullee wrote: Sun Feb 24, 2019 6:33 pm ScreenCaptures look terrific though
I know right? seems i'm the only one who finds that pictures speak a 1000 words
carlopav wrote: Sun Feb 24, 2019 5:45 pm I'm quite new to freecad, started less or more like you at the beginning of 2019. Since there could be people who like it maybe we need to wait for their feedback or just leave a coexistence period to let people appreciate the new mode.
Well i'm quite familiar with what you are describing about the import of DXF and the wish to be able to modify as I've imported Dxf's several times and yes if there was an ability to edit it without breaking it etc etc. So in general I have a feeling you know what you are trying to get at. However I can't really say much at this point as 1. Too much chat without consistent pics and videos properly explaining, 2. need to test it and and find out, before I can make a decent comment. So for now my general sense is that you are in the right direction based on all I read so far. Even though I don't quite follow very well.
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Post by Moult »

carlopav wrote: Sun Feb 24, 2019 5:45 pm
Nah, after rethinking and realising that graph object subelements are always visible, I don't think we need a new draft edit mode. Instead I propose:
I'm a bit confused :? Trying to recap the purpouse for editing modes:
- The first is displayed just as an option in the standard transformation and non transformation modifiers (called something like "subelement E(d)iting")
- The second is the Draft Select mode that higlight all the hidden subelement geometry and sets the modifiers to work on subelements (if it's like this, we can continue to call it "D, E". "D, S" if you prefer).
- The third is the node Edit (Toggled by "N, E" or a status bar button).
Did I get it?
Yep - the first is merely a mode in the existing modifiers so that they impact subelements, not entire objects. The second highlights draft objects that are hidden. The third exposes nodes and edit points for parametric objects. I am working on the first mode, the second mode is practically done in the PR, just needs more testing, and you are working on the third :)

I will implement subelement editing for rotate (+copy), scale (+copy), and then I'll stop making changes and wait for merging. In the future subelement mode can be added for things like array, clone, fillet, etc.

What's on your roadmap?
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

Very good. To end up with this three modes would be great.
At the moment i'm working on two different sides:
- On the existing draft edit tool I'm adding the possibility to modify arch objects: arc are working and already in the PR, wall have just the possibility to edit base geometry, but i was planning to add an editpoint to control the height as @yorik suggested, i almost finished window editing (to control width and height parameters), but i'd like to make it work also on non vertical windows, i just need a bit of math.
- I was trying to rewrite the entire tool, splitting it in two parts: the first that just place editpoints on selection, and the second that is activated when an editpoint is clicked, and do less or more what the old draft edit did (plus editing arch obj). Resulting in something that dont slow down performances.

There is only one thing that is blocking me in both paths: the current editpoint tracker have some problems:
1) is not always in front, so many times it's difficult to click it (expecially if not in the front or top view). Yorik suggested to make a workaround that should work but i didn't get, aslo if i still have to seriously try to.
2) also if it is in front and i'm able to click it, FreeCAD processes the mouse click also as a selection, that cause me several problems with the rewriting of the tool...

So i think it will take me some time to be able to end up with something to merge. :roll:
@regis, I'm sorry for the rivers of words, i hope we are able to make a woring prototype soon so everybody can test it.
follow my experiments on BIM modelling for architecture design
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Draft Edit improvements

Post by yorik »

carlopav wrote: Mon Feb 25, 2019 3:23 pm 1) is not always in front, so many times it's difficult to click it (expecially if not in the front or top view). Yorik suggested to make a workaround that should work but i didn't get, aslo if i still have to seriously try to.
Actually a discussion between werner and moult in another thread made me rethink of this... At the moment, the edit points are normal nodes, placed "in front" of the others by moving them to the top of the scenegraph (see in drafttrackers.py). As yousaw, this doesn't work well. But coin also has a mechanism to always draw a node on top of the others, no matter its real position, called SoAnnotation.

So I think we should simply encapsulate the edit tracker points inside a SoAnnotation, hopefully that will be enough to solve the problem.

About the rest of the discussion, excellent, go ahead! Indeed one aspect is that often you want to move several objects, and you just click on several of them in the view, actually selecting subobjects, but in reality wanting to move the whole objects. This should indeed be addressed somehow.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

yorik wrote: Tue Feb 26, 2019 6:43 pm So I think we should simply encapsulate the edit tracker points inside a SoAnnotation, hopefully that will be enough to solve the problem.
Very good! I was also planning to check how the constrain markers in the sketcher works, but this solutions looks better, hope i have some time in the weekend to work on that... i just completed my todo list at work and it's a bit of a pita :? :?
About the rest of the discussion, excellent, go ahead! Indeed one aspect is that often you want to move several objects, and you just click on several of them in the view, actually selecting subobjects, but in reality wanting to move the whole objects. This should indeed be addressed somehow.
Yes, i think you are right, i didnt consider this point. Considering that main goal is to provide quick editing for parametric objects, my opinion is that editpoints should always go with the whole object. But selection is first addressed to subobjects... So this looks not consistent... You are right. I'll keep it in mind when every other aspect work, so we can tackle also this point.
follow my experiments on BIM modelling for architecture design
Post Reply