#4828 PartDesign: inverse for pocket

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!
user1234
Veteran
Posts: 3336
Joined: Mon Jul 11, 2016 5:08 pm

Re: #4828 PartDesign: inverse for pocket

Post by user1234 »

At least you know some opinions, but yes, more would be useful.

Thanks!

Greetings
user1234
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: #4828 PartDesign: inverse for pocket

Post by openBrain »

adrianinsaval wrote: Thu Sep 16, 2021 7:51 pm Actually I've been thinking about changing the implementation so it isn't actually a boolean common but a pocket using the complement of the selected face but still haven't found the time to do it. What are the thoughts of others, should this PR be put on hold so that it doesn't become a breaking change in the future?
Using OCC common for implementation is correct and probably more reliable than trying to use some other computations. IIRC pocket is implemented with an OCC cut actually.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: #4828 PartDesign: inverse for pocket

Post by chrisb »

As you can see on the first page of this topic, I was in favor of "Common" too, because that's what it is from a rather mathematical point of view. However, I was convinced, that this name is not appropriate for PartDesign. I see every now and then questions asking about this function, but nobody ever asked for a common operation. Instead people want to know how the can remove what is outside of their sketch.

I have personally the view of a pocket of being something dynamic, like a mill that takes the material away. And indeed was the notion "pocket" used for milling before CAD systems were easily available. And I find it quite natural to ask for a function taking the outside away and not the inside.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: #4828 PartDesign: inverse for pocket

Post by adrianinsaval »

openBrain wrote: Thu Sep 16, 2021 9:29 pm Using OCC common for implementation is correct and probably more reliable than trying to use some other computations. IIRC pocket is implemented with an OCC cut actually.
kinda, it's a single occ function tha does the extruding and cuting away. Anyway, look at the following example drawn on mspaint :lol:
Sin título.png
Sin título.png (6.19 KiB) Viewed 5911 times
if you have a cube and you draw a narrower rectangle in a face then do a pocket "outside" that is not through all the geyed part of the cube on the rigth will be removed, my idea is to make it behave as the cube on the left. This is in my opinion more inline with how one expects pocket to behave. Not that FreeCAD has to copy it but I think CATIA has that behavior.

Not sure if that would be possible for all operations (or even pocket itself ot be honest). Anyway, this PR causes problems with patterns that use these features, not sure how to solve them, probably needs major changes on how pattern handles stuff, this issue should be already present in master with helix outside I think.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: #4828 PartDesign: inverse for pocket

Post by chrisb »

adrianinsaval wrote: Thu Sep 16, 2021 10:29 pm Anyway, look at the following example drawn on mspaint
I don't understand this. Which are the sketches in these examples?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: #4828 PartDesign: inverse for pocket

Post by adrianinsaval »

sorry, guess I rushed too much, the sketches would be on the XZ plane, their projections highlighted in orange
drawing.png
drawing.png (4.14 KiB) Viewed 5809 times
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.
Attachments
example.FCStd
(45.85 KiB) Downloaded 120 times
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: #4828 PartDesign: inverse for pocket

Post by openBrain »

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
That's really a point. I agree that correct behavior is the left one. Not so simple actually. I have enough check the PR again, but probably it indeed need to be reworked.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: #4828 PartDesign: inverse for pocket

Post by chrisb »

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
Thanks, it's clear now. For ease of understanding I add a picture here (rearranged the positions in your file to meet the previous image)
Attachments
SnipScreenshot-af1eef.png
SnipScreenshot-af1eef.png (23.88 KiB) Viewed 5639 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: #4828 PartDesign: inverse for pocket

Post by rynn »

Current and Regular are the exakt same.<
Current is wrong.

Edit:
No longer. OP fixed the image.
Last edited by rynn on Fri Sep 17, 2021 10:09 am, edited 2 times in total.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: #4828 PartDesign: inverse for pocket

Post by chrisb »

Oops, will fix it. Thought I had just used the transform tool.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply