missing feature to change loft section order

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

missing feature to change loft section order

Post by uwestoehr »

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 2291 times
(used testfile:
Loft-play.FCStd
testfile
(31.91 KiB) Downloaded 41 times
)

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

Re: missing feature to change loft section order

Post by chrisb »

Can this be added to the sweep too? Or is TheMarkster's pull request already handling this?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to change loft section order

Post by uwestoehr »

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
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Post by chrisb »

Thanks for working on this!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to change loft section order

Post by uwestoehr »

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
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to change loft section order

Post by uwestoehr »

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
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: missing feature to change loft section order

Post by edi »

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
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: missing feature to change loft section order

Post by uwestoehr »

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?
Post Reply