missing feature to change loft section order

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
User avatar
uwestoehr
Posts: 1730
Joined: Sun Jan 27, 2019 3:21 am

missing feature to change loft section order

Postby uwestoehr » Mon Sep 14, 2020 10:27 pm

For lofts it makes a difference in what order the sections are lofted. However, it is correctly not easily possible to change the sections order.

This is now possible with this PR: https://github.com/FreeCAD/FreeCAD/pull/3871

Here is how it works now
vtDSl750Ds.gif
vtDSl750Ds.gif (345.86 KiB) Viewed 343 times
(used testfile:
Loft-play.FCStd
testfile
(31.91 KiB) Downloaded 3 times
)

(The code the change the sorting is taken from the feature transform dialogs.)
chrisb
Posts: 26920
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Postby chrisb » Mon Sep 14, 2020 10:34 pm

Can this be added to the sweep too? Or is TheMarkster's pull request already handling this?
User avatar
uwestoehr
Posts: 1730
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to change loft section order

Postby uwestoehr » Tue Sep 15, 2020 11:35 am

chrisb wrote:
Mon Sep 14, 2020 10:34 pm
Can this be added to the sweep too? Or is TheMarkster's pull request already handling this?
Good question, I will add the sorting to the sweep dialog with another PR this evening.

Themarkster's PR does not handle sweeps. I think when his PR went in, he will probably extend it to sweeps too ;) .

TheMarkster wrote: .
chrisb
Posts: 26920
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Postby chrisb » Tue Sep 15, 2020 12:40 pm

Thanks for working on this!
User avatar
uwestoehr
Posts: 1730
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to change loft section order

Postby uwestoehr » Tue Sep 15, 2020 11:44 pm

chrisb wrote:
Tue Sep 15, 2020 12:40 pm
Thanks for working on this!
Here is a PR that add this: https://github.com/FreeCAD/FreeCAD/pull/3874

However, I cannot find a case where the section order for sweeps makes a difference. Can you please attach a file where it does that I can properly test the PR?
chrisb
Posts: 26920
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Postby chrisb » Wed Sep 16, 2020 6:38 am

uwestoehr wrote:
Tue Sep 15, 2020 11:44 pm
However, I cannot find a case where the section order for sweeps makes a difference. Can you please attach a file where it does that I can properly test the PR?
I am sorry to have this brought up. I wasn't aware that the sections are just taken as they occur along the path. This can come very handy when adding an additional section in the middle. Until now I always have rearranged the sections.
Thanks for the find.
User avatar
uwestoehr
Posts: 1730
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to change loft section order

Postby uwestoehr » Wed Sep 16, 2020 11:22 am

chrisb wrote:
Wed Sep 16, 2020 6:38 am
Until now I always have rearranged the sections.
I am now confused. So changing the order of sections has no effect, right? If so, I will have to retract my PR.
chrisb
Posts: 26920
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Postby chrisb » Wed Sep 16, 2020 12:57 pm

uwestoehr wrote:
Wed Sep 16, 2020 11:22 am
So changing the order of sections has no effect, right? If so, I will have to retract my PR.
That's what I have observed. However, I'm looking at it just as a user, perhaps some initiated developer can judge better, if there are cases where the order matters, from looking at the code.
And even if it doesn't matter, it may be convenient to reorder the sections just to keep the tree tidy.
edi
Posts: 72
Joined: Fri Jan 17, 2020 1:32 pm

Re: missing feature to change loft section order

Postby edi » Wed Sep 16, 2020 1:09 pm

I want to point to https://forum.freecadweb.org/viewtopic.php?f=19&t=47722.
There you will find a short script creating an AdditiveLoft and a workflow how to use it. If you comment the line
Sketches.sort(key=name)
the sections are taken in the order you selected it in the model tree. Therefore you can select the order of sections as you want.
User avatar
uwestoehr
Posts: 1730
Joined: Sun Jan 27, 2019 3:21 am

Re: missing feature to change loft section order

Postby uwestoehr » Wed Sep 16, 2020 1:54 pm

edi wrote:
Wed Sep 16, 2020 1:09 pm
the sections are taken in the order you selected it in the model tree. Therefore you can select the order of sections as you want.
Thanks. I know that one can change the sketch order. I am looking for an example in which one can see the difference of a changed sketch order. If you could create such an example with your macro, could you please attach the resulting FC file here?