[merged] PR #5357 - add feature to create tapered Pads / Pockets

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
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:

[merged] PR #5357 - add feature to create tapered Pads / Pockets

Post by uwestoehr »

This PR adds a requested feature to create tapered Pads / Pockets:
https://github.com/FreeCAD/FreeCAD/pull/5357

Other CAD programs provide this and also our Pad Extrude feature has this. The PR therefore takes basically the Part Extrude code.

Here are screencasts of the feature in action:
FreeCAD_phD8DANHBv.gif
FreeCAD_phD8DANHBv.gif (373.28 KiB) Viewed 9854 times
FreeCAD_fzqdB1cbDr.gif
FreeCAD_fzqdB1cbDr.gif (99.83 KiB) Viewed 9854 times

For developers: The method of building the Pad / Pocket with the angle is universal. There is a comment in the code that one should better not use BRepFeat_MakePrism for Pads. With my PR I could get rid of BRepFeat_MakePrism since I can set the angle to zero and build a tapered pad also with the implemented BRepOffsetAPI_ThruSections method. Is this would be advantageous I can make a PR accordingly after this PR is merged.
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by chrisb »

Great addition, thanks!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by davidosterberg »

Cool feature. Great for castings where draft angles are needed,
drmacro
Veteran
Posts: 8866
Joined: Sun Mar 02, 2014 4:35 pm

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by drmacro »

Thanks for the new feature! Any idea when it'll be merged?

Speaking of the Part workbench Extrude operation (I know of no Pad Extrude as mentioned in the OP... :?: )

What does the second entry in the "Taper outward angle" do? I made each of these extrudes with a different value in the second field and see no difference.
Snip macro screenshot-4beec1.png
Snip macro screenshot-4beec1.png (76.75 KiB) Viewed 9688 times
ExtrudeAngles.png
ExtrudeAngles.png (41.46 KiB) Viewed 9688 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by uwestoehr »

drmacro wrote: Sat Jan 08, 2022 2:05 pm What does the second entry in the "Taper outward angle" do? I made each of these extrudes with a different value in the second field and see no difference.
These are the taper angles for both directions:
FreeCAD_LRChL9d1SF.png
FreeCAD_LRChL9d1SF.png (33.11 KiB) Viewed 9624 times
You did not set a length for the second direction, therefore you did not see anything.

I am already working on the dialog since it is not intuitive, lacks labels and tooltips. but this thread is about the PartDesign PR.
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by jonasb »

uwestoehr wrote: Sat Jan 08, 2022 4:46 pm I am already working on the dialog since it is not intuitive, lacks labels and tooltips.
Please consider sharing the same docs for property description and corresponding tooltips. I've made a first step with PR 5321 for PartDesign but put further work on hold as I've seen you're currently working on the same files; e.g. with for this PR here (which is very welcome!).
uwestoehr wrote: Sat Jan 08, 2022 4:46 pm ...but this thread is about the PartDesign PR.
Indeed. Sorry for hijacking.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by uwestoehr »

jonasb wrote: Sat Jan 08, 2022 5:49 pm Please consider sharing the same docs for property description and corresponding tooltips. I've made a first step with PR 5321 for PartDesign
Nice. Every work for the Part WB is welcome because its dialogs need work. Its tooltips (and the ones of the underlying parameter description) need a revision.
Looking forward for you PRs ;)

--------------
And now please only concerning this PR. For all other issues, please open new threads.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by TheMarkster »

Did you try with sketches with nested wires? The Part::Extrude tool fails to taper with such sketches. For example, this sketch:
Snip macro screenshot-0e6eef.png
Snip macro screenshot-0e6eef.png (53.8 KiB) Viewed 9488 times
Produces this extrude (failing to cut the inner material).
Snip macro screenshot-15fd96.png
Snip macro screenshot-15fd96.png (39.44 KiB) Viewed 9488 times
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by jonasb »

TheMarkster wrote: Sun Jan 09, 2022 12:15 am Did you try with sketches with nested wires?
I just tried and it does not work: As soon as I set the taper angle to something != 0, only the outer-most wire is considered, the inner ones are ignored -- same as with Part's extrude.

Code: Select all

OS: macOS Mojave (10.14)
Word size of FreeCAD: 64-bit
Version: 0.20.27004 (Git)
Build type: Release
Branch: donovaly-PD-tapered-PadPocket
Hash: 3413c5e921151d41fbadad7eee4623295c374f59
Python version: 3.9.8
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.0
Locale: English/United States (en_US)
Another wish: Please extend the existing test suite of Pad/Pocket to cover the new functionality. Your screencasts show a lot of new cool stuff, but your PR does not include a single automated test for this.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #5357 - add feature to create tapered Pads / Pockets

Post by uwestoehr »

TheMarkster wrote: Sun Jan 09, 2022 12:15 am Did you try with sketches with nested wires? The Part::Extrude tool fails to taper with such sketches.
This is on purpose because I took purposely the Part Extrude code. If there is a taper angle, it only takes the outer wire of the sketch to extrude.

One could also take the inner wires as PartDesign Loft does so there must be a reason. And when thinking on how to implement the tapered option for inner wires I can imagine why these are not handled:
- for example if you have a circular hole in your sketch, you probably don't want to have it a taper angle, only for the outer sketch wire
- if you have an inner wire, you might want to have a different taper angle. For example when molding plastics the shrinkage is volume-dependent and then the inner taper angles might indeed have different values

So I don't want to reinvent the wheel. Part's Extrude feature is there for ages and obviously people can live that inner wires are not extruded when there is a taper angle.
Post Reply