#4828 PartDesign: inverse for pocket
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: #4828 PartDesign: inverse for pocket
Fixed the image above. The issue was of course the recompute, which did on my precompiled version the same as the normal pocket - of course.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: #4828 PartDesign: inverse for pocket
PR is closed.
Re: #4828 PartDesign: inverse for pocket
It would be appreciated!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: #4828 PartDesign: inverse for pocket
I plan on eventually working on it, but no promises on when. Of course if someone else wants to do it they're welcomed. If I fail should resubmit the changes from this PR?
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: #4828 PartDesign: inverse for pocket
If you select the regular pocket and run the PDWrapper macro, selecting common additive as the wrapper type, you get the desired result.adrianinsaval wrote: ↑Fri Sep 17, 2021 2:39 am sorry, guess I rushed too much, the sketches would be on the XZ plane, their projections highlighted in orange
drawing.png
Also, here's a file showcasing this, you should be able to open it in regular FreeCAD but recomputing the pocket in the first body would turn it into a regular pocket just like the second body.
With patterning tools, if you make linear pattern you will get repeated copies of this common boolean result and they will be fused with existing material since the wrapper is an additive type. If you select the common subtractive type, then the pattern tool will cut material from where the copies are placed.
- adrianinsaval
- Veteran
- Posts: 5548
- Joined: Thu Apr 05, 2018 5:15 pm
Re: #4828 PartDesign: inverse for pocket
No, the desired result is the T shape, you get the same result as the PR with that methodTheMarkster wrote: ↑Sat Dec 11, 2021 6:00 am If you select the regular pocket and run the PDWrapper macro, selecting common additive as the wrapper type, you get the desired result.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: #4828 PartDesign: inverse for pocket
I see. I updated WireFilter macro to include as one of the facemaker types "InvertedFace".adrianinsaval wrote: ↑Mon Dec 13, 2021 2:00 pm
No, the desired result is the T shape, you get the same result as the PR with that method
Original sketch in a new body created from your example:
WireFilter made from sketch with regular face (facemakerbullseye): Note: box is hidden because of z-fighting making it difficult to see the new face.
WireFilter now with new face type: "InvertedFace" (instead of facemakerbullseye):
(Note the new facemaker type: "InvertedFace" and the new property InvertedFaceScale (default: 5 currently).
Then the pocket made from the WireFilter: (If multiple faces, select the faces in the 3D view for the pocket -- pocket needs to be reversed in this case)
Inverted Face Scale property only scales the outerwire.
- Attachments
-
- WireFilter.FCMacro
- (36.24 KiB) Downloaded 100 times
Re: #4828 PartDesign: inverse for pocket
As a potential "Remove Outside" property for PartDesign's Pocket and Groove operation does not need to be as universal as your wire filter, calculating this "outside wire" based on the base feature's bounding box could work.TheMarkster wrote: ↑Mon Dec 13, 2021 7:43 pm Note the new facemaker type: "InvertedFace" and the new property InvertedFaceScale (default: 5 currently)
Using "common" instead of "cut", and thus without the additional "outside wire", could be an optimisation in the case of "Symmetric to plane" and "Thought all" are set for Pocket. Or if the revolution angle is 360° for Groove. No idea whether it's worth the effort, though.
For the subtractive Loft and Sweep work, we may also have the two use cases of "remove outside" (only in the H/V direction of the sketch) and "enveloping" (removing the outside also in the sketches normal direction, i.e. boolean common).
The subtractive primitives may only need the enveloping.
For Hole and Subtractive Helix I see no sensible use case of either, "remove outside" and "enveloping". (Ironically, the subtractive helix has implemented such an enveloping, calls it "Outside" and implements it using boolean common.)
Recently, I was in the need for such an "enveloping groove" quite often. Is someone currently working on this?
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: #4828 PartDesign: inverse for pocket
Possibly it could work to use the BoundBox. My initial concern would be in cases where the sketch normal is not orthogonal to a base plane, but I haven't thought it through.
Using common could work with the pocket itself in some cases, as you've mentioned, such as through all, but the problem with that will be if the user decides to use the pocket in a pattern feature. For example, a polar pattern would use the pocket's AddSubShape (what you would get extruding the sketch basically) as a cutting tool when making the copies. This is because the polar pattern code assumes a cut was used for the original pocket. Maybe the pattern tools could be modified to work with such pockets, but even at best it would be adding much complexity to the source code. Better, I think, to expand the profile so that nothing needs to be done with pattern tools. Such a thing would also make it clearer to the user exactly what is happening.
Using "common" instead of "cut", and thus without the additional "outside wire", could be an optimisation in the case of "Symmetric to plane" and "Thought all" are set for Pocket. Or if the revolution angle is 360° for Groove. No idea whether it's worth the effort, though.
For the subtractive Loft and Sweep work, we may also have the two use cases of "remove outside" (only in the H/V direction of the sketch) and "enveloping" (removing the outside also in the sketches normal direction, i.e. boolean common).
Another option to consider is another macro I have called PDWrapper. With it one can essentially convert a subtractive (or additive) feature to a common feature. It has the same problems with pattern tools as mentioned above, but being a different animal different behavior is to be expected, unlike where we replace the cut with a common in a pocket operation. Consider this model with a subtractive groove:
The subtractive primitives may only need the enveloping.
For Hole and Subtractive Helix I see no sensible use case of either, "remove outside" and "enveloping". (Ironically, the subtractive helix has implemented such an enveloping, calls it "Outside" and implements it using boolean common.)
Recently, I was in the need for such an "enveloping groove" quite often. Is someone currently working on this?
and after converting the groove to a common additive:
In the edit placement adjustments dialog one can toggle the tip tool, tip base, and tip shape objects, color coded:
PDWrapper is a beastly macro, quite powerful, and even more complicated to use. But with great power comes great complexity. I plan to make a video to document its use, but it will probably take several videos.
Install PDWrapper and run it to create the pdwrapper.py file before opening the attached file.