Parametric Defeaturing Macro updated to 2021.10.10.rev2

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Parametric Defeaturing Macro updated to 2021.10.10.rev2

Post by TheMarkster »

Updated to 0.2021.10.10.rev2
Implement double click in tree to bring up face editor dialog.

*******
Updated to version 0.2021.10.10
Bug fix: when object is deleted we need to ensure the next feature inherits the correct BaseFeature, else all previous features are no longer part of the Tip.

*******
Parametric defeaturing comes to Part Design.

Available on the wiki for installing with the Addon Manager.

https://wiki.freecadweb.org/Macro_Param ... efeaturing

Full documentation on github: https://github.com/mwganson/parametric_defeaturing

This tool is similar to the defeaturing tool in Part workbench. I even stole the icon. It differs in a couple ways: 1) it's fully parametric and 2) it can be used in Part Design, as well as outside Part Design.

Usage: select the faces you wish to remove and run the macro. Note: Faces are used in defeaturing, not edges or vertices. The macro checks for this error and filters out any selected subobjects that are not faces.
parametric_defeaturing_scr2.png
parametric_defeaturing_scr2.png (169.25 KiB) Viewed 4375 times
It has a very simple face editor you can use to select different faces from the ones originally selected during object creation. The task dialog has only 2 buttons: OK and Cancel. And it has a small text label with instructions to select the desired faces in the 3D view, and then click OK. To bring up the editor toggle the Edit Faces property from False to True. It will set itself back to False ready for the next trigger action.
parametric_defeaturing_scr.png
parametric_defeaturing_scr.png (30.32 KiB) Viewed 4375 times
Parametric is generally a good thing, but due to the topological naming problem and because of the way defeaturing works on face objects changes to the original source object will very likely break the ParametricDefeaturing object. Luckily, it's a snap to fix such issues with the simple editor I have implemented. The default PropertyLinkSub editor in FreeCAD is a not very user-friendly.
Last edited by TheMarkster on Sun Oct 10, 2021 9:28 pm, edited 2 times in total.
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Parametric Defeaturing Macro

Post by chrisb »

That's a great announcement! I think it should even go into master.

I don't think that toponaming is a big deal here: in a properly developed model you don't use defeaturing in the middle of the process, you change or even delete the steps which led to the wrong model.

The main usage is for imported (preferably step) models and these are static and don't change inadvertently. Nevertheless it is interesting to have it parametric so that you can go back and change the defeatures.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Parametric Defeaturing Macro

Post by TheMarkster »

I don't think we can make a blanket statement that you should never use defeaturing in a properly designed model. Consider the case where I need a 12-hole pattern, but I only want 10 holes (none at 3 o'clock or 6 o'clock positions). In this case defeaturing might be a reasonable approach.
Snip macro screenshot-8dd15f.png
Snip macro screenshot-8dd15f.png (71.89 KiB) Viewed 4159 times
Other scenarios:
  • Temporary construction mode geometry to be used as a reference and later removed
  • Temporary support is needed until separated elements are later united in a subsequent step
  • You use pocket through all, but you don't want the pocket in one or more of the inner walls
Not necessarily proper, but justified:
  • Due to time constraints defeaturing can be used as a quick fix until there is time to do a more proper re-design later.
  • You have run into a topological naming issue and rather than spend the time on a relatively unimportant project diagnosing the problem defeaturing can be used instead.
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Parametric Defeaturing Macro

Post by chrisb »

Sensible use cases, indeed.
Off topic concering the first use case: with a Draft Link array you can suppress individual occurrences. It would be nice to have this in PartDesign too.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply