Proposal of some Loft and Pipe refactoring
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Proposal of some Loft and Pipe refactoring
As for now Loft and Pipe features are considered to be ProfileBased features that leads to their quite unnatural structure: they both have a single base Profile and several additional Sections. This could make some sense for a pipe, because it could have only one section, but it's very confusing for lofts where sections considered to be more or less equal. Besides that, such structure leads to that Loft and Pipe has additional properties like "MidPlain" and "Reverse" which don't make any sense for them either.
I want to propose to refactor them:
- Make them direct descendent of AddSubFeature
- Move some common code Loft&Pipe utilize from ProfileBased into static methodes
- Add automatic migration for Loft&Pipe themself (shouldn't be hard)
- Refactor UI accordingly
As consequence those features will look much more straight forward from both user POV and internal structure.
Forward compatibility will be somewhat lost, but backward (with silent convert upon opening) should be intact.
Your thoughts?
I want to propose to refactor them:
- Make them direct descendent of AddSubFeature
- Move some common code Loft&Pipe utilize from ProfileBased into static methodes
- Add automatic migration for Loft&Pipe themself (shouldn't be hard)
- Refactor UI accordingly
As consequence those features will look much more straight forward from both user POV and internal structure.
Forward compatibility will be somewhat lost, but backward (with silent convert upon opening) should be intact.
Your thoughts?
Re: Proposal of some Loft and Pipe refactoring
Moved from Part Design module development forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Proposal of some Loft and Pipe refactoring
I don't understand this. When a loft has equal sections, a pad should be used instead.Fat-Zer wrote: ↑Mon Mar 06, 2023 1:27 am As for now Loft and Pipe features are considered to be ProfileBased features that leads to their quite unnatural structure: they both have a single base Profile and several additional Sections. This could make some sense for a pipe, because it could have only one section, but it's very confusing for lofts where sections considered to be more or less equal.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Proposal of some Loft and Pipe refactoring
Aah, I understand. That's indeed an imbalance. And it is more than just an aesthetic thing, because it is possible to reorder the sections, but the first one remains always the first. I use this reordering very rarely but I remember that I once wanted to exchange the first section with another one which was not as straight forward as expected.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Proposal of some Loft and Pipe refactoring
sounds like a good idea to me, the nonsensical properties could be just made to be hidden properties here I think, but the argument about the first profile not being any different from the rest is a very good argument, unifying them could also allow for reordering of profiles I think. @chrisb Part design development was a correct place to put this IMO, did you move this for visibility? In any case it should go into developers corner I think, I don't know if many devs lurk in open discussions as there can be many many post around here. @Fat-Zer I suggest creating a github issue for this and later mention that in a PR if you make one.
Since ProfileBased is also a good description for these features, could it make more sense to just extend or modify it so that it can have a profile list too and just hide the not relevant properties?
Since ProfileBased is also a good description for these features, could it make more sense to just extend or modify it so that it can have a profile list too and just hide the not relevant properties?
Re: Proposal of some Loft and Pipe refactoring
I had indeed pondered a while over the correct place: PartDesign seemed inappropriate, because there is also Part->Loft, and they should both be considered. As it is not purely an implementation detail I didn't place it in the developers forum, but here in Open discussion, where the impact on the user interface can also be discussed.adrianinsaval wrote: ↑Mon Mar 06, 2023 12:33 pm @chrisb Part design development was a correct place to put this IMO, did you move this for visibility? In any case it should go into developers corner I think, I don't know if many devs lurk in open discussions as there can be many many post around here.
+1@Fat-Zer I suggest creating a github issue for this and later mention that in a PR if you make one.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Proposal of some Loft and Pipe refactoring
Implementation wise PD loft and pipe are independent of their Part WB counterpart AFAIK, furthermore this:
is exclusively related to PDBesides that, such structure leads to that Loft and Pipe has additional properties like "MidPlain" and "Reverse" which don't make any sense for them either.
I want to propose to refactor them:
- Make them direct descendent of AddSubFeature
- Move some common code Loft&Pipe utilize from ProfileBased into static methodes
Re: Proposal of some Loft and Pipe refactoring
You are right, in Part workbench all sections are in the same list "Sections", nothing distinguishes the first sketch - except the position in the list.adrianinsaval wrote: ↑Mon Mar 06, 2023 4:09 pm Implementation wise PD loft and pipe are independent of their Part WB counterpart AFAIK,
As there are no other user comments, I move the topic back to PartDesign development.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.