FreeCAD Hack (hitting the bullseye)

A place to share learning material: written tutorials, videos, etc.
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

FreeCAD Hack (hitting the bullseye)

Post by TheMarkster »

This hack is done using this version. Perhaps it will not work the same way in different versions.

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.25997 (Git)
Build type: Release
Branch: master
Hash: 77b198048a63f1e9ca15eef64c8042d599a14cf3
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)

Part Design::Pad fails on this sketch, but with this hack we can make it work.
Snip macro screenshot-f3734e.png
Snip macro screenshot-f3734e.png (80.32 KiB) Viewed 5021 times
In this article I will show you 3 different hacks. The first is padding a single (closed) edge from a sketch. If the edge is not closed then you must use the wires instead. The second hack is getting a non-Part Design 2D object into the Part Design Body. The 3rd hack is Padding the bullseye faces.

Hack #1, a prelude to the main hack. We need to have some support or else our hacked pad will fail due to the multiple solid prohibition in Part Design. Make the sketch visible and select the outer edge in the 3D view. Make note of the statusbar where it gives the name of this edge. In this case it is Edge11.

Attempt the Pad. It will fail, but while the task dialog is still open switch to the model tab. The Pad is already there. Edit it's Profile property to be Sketch.Edge11. To do this you need to click the [...] button for the Profile property. Double click in the right column to the right of the Sketch and type in Edge11. Select the sketch again in the dialog and make sure it is selected and that Edge11 shows in the right column before pressing OK. Re-read the previous sentence if you get tripped up on this step because it is a tricky one.
Snip macro screenshot-65c13a.png
Snip macro screenshot-65c13a.png (22.99 KiB) Viewed 5021 times
Switch back to the Task tab and press OK. Voila! We have padded only a single edge of a sketch. This can also use Wire1, Wire2, etc., but there is no really easy way at this time to see which edges belong to which wires except trial and error.

Edit the reversed property so that the pad is in reverse and set the LengthFwd to 3mm. This is not strictly necessary, but that's what I did here.

Now hide the Pad and show the sketch. Go to Part workbench. Select the sketch, and in Part menu -> make face from wires. This creates the Part::Face object. It's outside the body and you will probably get link out of allowed scope warnings. Ignore them for the moment. We need now to put the Face into the body, which will silence the out of scope warnings and also the face object will use the Body's local coordinate system once inside the body.

Hack #2 -- getting the Face into the Body. Select the Body, select it's Group property, click the [...] button select the Face object click OK. The Face should now be in the Body and ready for use.

Hack #3 -- padding the bullseye. Back in Part Design workbench, select each face in the 3D view (unless you want to leave some out). Then do the Pad. It will give an unnecessary error message, but click OK and the Pad will still succeed.
Snip macro screenshot-31e802.png
Snip macro screenshot-31e802.png (85.68 KiB) Viewed 5021 times
Why does this work? It works because of the FaceMakers used in the 2 workbenches. Part Design tools use Part::FaceMakerCheese whereas the Part::Face tool uses Part::FaceMakerBullseye. Bullseye, as the name implies, can handle nested wires, wires within wires within wires, but Cheese cannot. Cheese can handle lots of holes in a face, like Swiss Cheese, but not holes within holes. There are 4 FaceMakers we can use:

Part::FaceMakerBullseye
Part::FaceMakerCheese
Part::FaceMakerExtrusion
Part::FaceMakerSimple

Only the first 2 can manage holes in faces, but the other 2 can manage cases where the first 2 fail due to non planar wires. Pad fails with the message that it cannot validate a broken face because FaceMakerCheese has failed and it has passed on that message to Pad. Give Pad a face (or faces from the same object) to work with and it can succeed. Most of the time it can, anyway.

Edit: You learn something new all the time in FreeCAD if you pay attention. Today I learned you can select edges in the 3D view when editing the PropertySubLink used in the Pad's Profile property. It is not necessary to manually type in Edge11. You can instead select it in the 3D view while the editor dialog is open.
Attachments
part_face_part_design.FCStd
(18.9 KiB) Downloaded 96 times
Last edited by TheMarkster on Mon Oct 18, 2021 9:31 pm, edited 1 time in total.
User avatar
M4x
Veteran
Posts: 1473
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: FreeCAD Hack (hitting the bullseye)

Post by M4x »

Very interesting, thank you!
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: FreeCAD Hack (hitting the bullseye)

Post by paullee »

Curious how similar model may be done by Part :)
  1. Select the Sketch, Click Extrude in Part
  2. In Face Maker Class, it is by default Part::FaceMakeBullseye, and an alternate solid and void model is created
  3. Select the Sketch, Click Extrude in Part again
  4. In Face Maker Class, make it Part::FaceMakeSimple, and got all rings solid
part_face_part_design_ r.FCStd
(25.61 KiB) Downloaded 85 times
Screenshot from 2021-10-18 23-17-38.png
Screenshot from 2021-10-18 23-17-38.png (266.05 KiB) Viewed 4831 times
Screenshot from 2021-10-18 23-17-43.png
Screenshot from 2021-10-18 23-17-43.png (268.74 KiB) Viewed 4831 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: FreeCAD Hack (hitting the bullseye)

Post by TheMarkster »

Note: with Extrude used in this manner on this sketch (changing to FaceMakerSimple) the resulting Extrude object is actually a compound of 11 solids.
You can apply Part::Fusion to it to fuse all 11 solids together. Set refine to true to lose the extra edges. But you are limited to only the outer wire because Extrude has a different property type for its profile, a type that does not allow to select edges/wires subobjects. Alternatively, you could explode the Extrude compound and select the solid you want to use that way.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: FreeCAD Hack (hitting the bullseye)

Post by uwestoehr »

Since FreeCAD you can directly extrude nested structures.
However, since PartDesign does not allow to have more than one body, you need a support plate. Here is an example what is now possible:
bullseye-simplified.FCStd
(42.81 KiB) Downloaded 64 times
Post Reply