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!
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: missing feature to change loft section order

Post by edi »

What is the
difference of a changed sketch order
?
Using a sketch order, a shape is generated. Using another order, another shape is generated. Do you want to
- see both shapes in the same document ?
- calculate the difference volume of the two created bodies ?
- change the sketch order while the shape is visible ?
chrisb
Veteran
Posts: 54143
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Post by chrisb »

edi wrote: Wed Sep 16, 2020 3:59 pm Using a sketch order, a shape is generated. Using another order, another shape is generated.
That's what I had thought as well, but it seems to be wrong. Please do as I did and try your statement with a real model. If there are differences, then upload that model. It's all what Uwe asks for.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: missing feature to change loft section order

Post by wmayer »

The OCC class BRepOffsetAPI_MakePipeShell offers many possibilities to influence the output of a pipe but in the FreeCAD source code only one possibility is used so far and if I got it right this way changing the order of sections doesn't affect the output.

So, for now the sorting capability seems quite useless but it can become handy when using the full power of BRepOffsetAPI_MakePipeShell.

Behind the scene the class BRepFill_PipeShell is used. Look at the implementation of "::Add"

IMO, the PR can be merged as it does no harm.
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 »

wmayer wrote: Wed Sep 16, 2020 5:00 pm IMO, the PR can be merged as it does no harm.
I would skip the part of changing the sketch order because it then seems that a feature is promised that is not yet available.
If you agree, I will make a new PR that only adds the feature of being able to delete sections by pressing DEL.

Thanks for the background info, I will have a look at the OCC docs and see what could be done.
chrisb
Veteran
Posts: 54143
Joined: Tue Mar 17, 2015 9:14 am

Re: missing feature to change loft section order

Post by chrisb »

If necessary, the sequence can always be changed by editing the Sections property.
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 »

wmayer wrote: Wed Sep 16, 2020 5:00 pm Behind the scene the class BRepFill_PipeShell is used.
I also had a look at use the OCC docs: https://dev.opencascade.org/doc/refman/ ... shell.html but cannot see a feature where the order of sections would make a difference.
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 »

I had a closer look and to me it seems FC allows everything already.

While playing around I found an issue of which I am not sure it is an over-eager warning of the tree view or a tree display issue by the pipe feature:
Here is the example file:
Loft-play.FCStd
testfile
(338.22 KiB) Downloaded 40 times
By the way, this pipe looks amazing:
FreeCAD_CDdz6W0o96.png
FreeCAD_CDdz6W0o96.png (51.62 KiB) Viewed 1474 times
When opening and closing the pipe dialog (without doing anything, i get this warning:

Code: Select all

Tree.cpp(297): [ComboView] duplicate child item Loft_play#AdditivePipe.Sketch001
This is because the pipe feature us the sketch "SketchHex" twice in it because I use it in the feature as section and auxiliary too. This is valid. So the question is if thee tree view should in this case not issue a warning or not.
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 »

uwestoehr wrote: Wed Sep 16, 2020 6:06 pm If you agree, I will make a new PR that only adds the feature of being able to delete sections by pressing DEL.
Here it is: https://github.com/FreeCAD/FreeCAD/pull/3876

This PR also adds this feature for the other 2 item lists of the sweep dialog.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: missing feature to change loft section order

Post by wmayer »

As I said when using the full power of the OCC API one can achieve a different order of the sections. Luckily the class BRepOffsetAPI_MakePipeShell is exposed to Python so here it goes:

Code: Select all

s1=App.ActiveDocument.Sketch.Shape
s2=App.ActiveDocument.Sketch001.Shape
s3=App.ActiveDocument.Sketch002.Shape
s4=App.ActiveDocument.Sketch003.Shape

b=Part.BRepOffsetAPI.MakePipeShell(s4)
b.add(s1, s4.Vertex3)
b.add(s2, s4.Vertex1)
b.add(s3, s4.Vertex5)
b.build()
Part.show(b.shape())
Attachments
sweep_order.FCStd
(18.27 KiB) Downloaded 39 times
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 »

wmayer wrote: Thu Sep 17, 2020 6:32 am As I said when using the full power of the OCC API one can achieve a different order of the sections. Luckily the class BRepOffsetAPI_MakePipeShell is exposed to Python so here it goes:
Thanks, now I understand. However, in your example, the resulting part's outer wall is black (the color I get when e.g. unions fail):
FreeCAD_ETkDSXgSUL.png
FreeCAD_ETkDSXgSUL.png (32.01 KiB) Viewed 1406 times
--------------------

Concerning your change
QListWidget::takeItem() returns a pointer to the removed item. So a previous call of QListWidget::item() is superfluous
This might apply for other OnDelete routines as well. I will have a look later and make a PR if this is the case.

-------------------

What about my PR for lofts:
https://github.com/FreeCAD/FreeCAD/pull/3871
Do I have to change there anything to be merged?
Post Reply