[Bug] #7189: Pad "Up to Last" ends too soon

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

[Bug] #7189: Pad "Up to Last" ends too soon

Post by jnxd »

If a looping face intersects a pad twice in a single direction, once as the last intersection, it only goes till the first instance instead of all the way. For e.g. See the following.
Screenshot from 2022-07-15 01-11-14.png
Screenshot from 2022-07-15 01-11-14.png (57.8 KiB) Viewed 1424 times
Attachments
base-model-for-pad.FCStd
(21.92 KiB) Downloaded 43 times
My latest (or last) project: B-spline Construction Project.
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by Shalmeneser »

ToLast is not an exact science.
Try to do the circular face with the 2 parts : the upper one and the bottom one.
Attachments
base-model-for-pad_SHALM.FCStd
(17.27 KiB) Downloaded 43 times
Capture d’écran 2022-07-14 230812.jpg
Capture d’écran 2022-07-14 230812.jpg (15.12 KiB) Viewed 1394 times
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by adrianinsaval »

I suspect it detects the outer face as last but provides the whole face as is as a limit to OCCT, but since it is touched already in the lower side it stops there, doesn't seem easy to solve an issue like this in the feature's code, would need a special consideration for faces that are touched more than once.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by jnxd »

adrianinsaval wrote: Fri Jul 15, 2022 3:43 am I suspect it detects the outer face as last but provides the whole face as is as a limit to OCCT, but since it is touched already in the lower side it stops there, doesn't seem easy to solve an issue like this in the feature's code, would need a special consideration for faces that are touched more than once.
One way to ameliorate this could be to ensure that the "last" face provided intersects at facing opposite to the pad direction (or along the pocked direction). This would not be the final solution, however: a sufficiently complicated shape can still break this.
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by adrianinsaval »

It's that even possible? Does OCC take that into account?
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by jnxd »

adrianinsaval wrote: Fri Jul 15, 2022 12:41 pm It's that even possible? Does OCC take that into account?
From what I can tell looking at the code, up to face/first/last all behave in the same way: a face is identified by FC, then that is passed to OCC. So at least the first part is our responsibility.
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by adrianinsaval »

yes but the issue here is that it is an ellipse, I suspect FreeCAD is passing the correct last face but since that face is intersected twice OCCT cuts it at the first intersection, but the user expects the "last" to be the second intersection. At least that is what I suspect.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by jnxd »

adrianinsaval wrote: Fri Jul 15, 2022 4:23 pm yes but the issue here is that it is an ellipse, I suspect FreeCAD is passing the correct last face but since that face is intersected twice OCCT cuts it at the first intersection, but the user expects the "last" to be the second intersection. At least that is what I suspect.
I suspect the same too. What I'm saying is that there is an opportunity within FreeCAD to try and correct this if possible. Though that's as far as I should say without looking deeper at the code myself.
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by adrianinsaval »

If OCCT doesn't provide a way of telling it to use the last intersection this would require splitting the face before passing it to OCCT, I don't know how to programmatically identify where to split but then again I'm not a real programmer so it might be easy or at least not too hard for others.

Also, if there isn't a github issue for this it should be created
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Bug] #7189: Pad "Up to Last" ends too soon

Post by jnxd »

adrianinsaval wrote: Fri Jul 15, 2022 4:47 pm Also, if there isn't a github issue for this it should be created
It's created: issue #7189 as the title says :lol:
My latest (or last) project: B-spline Construction Project.
Post Reply