Any Suggestions for Chamfering Sharp Angles

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
NilDesperandum
Posts: 27
Joined: Tue Sep 29, 2020 12:26 am

Any Suggestions for Chamfering Sharp Angles

Post by NilDesperandum »

Hello all,

I am currently trying to figure out a way to chamfer an object that has a sharp corner (such that the chamfer regularly fails). See image below
object43.PNG
object43.PNG (5.44 KiB) Viewed 955 times
In short it is basically a semi-circle on this part of the object, but only one side will chamfer. I have tried using a try-except statement such that if the regular chamfer fails I create a small block, chamfer the block, and use the block to cut out the corner where the chamfer would be, but the try-except statement does not run like I expect (doesn't catch the excepts properly).

I am fairly certain the problem arises from the chamfering edges overlapping at the corner, but I am not sure if there is a workaround for that.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22960 (Git)
Build type: Release
Branch: master
Hash: c5a4b01d2e4218bcc0eb6650337650a6c65ef0e4
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by chrisb »

You can try with a more recent version with OCC 7.5. If it doesn't work, you may use a sweep. In this special case a revolve could work as well.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by chrisb »

I'm looking through my recent posts searching something, and found that I didn't ask for a file, so that interested helpers can play with it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
NilDesperandum
Posts: 27
Joined: Tue Sep 29, 2020 12:26 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by NilDesperandum »

chrisb wrote: Sat Apr 10, 2021 10:02 pm You can try with a more recent version with OCC 7.5. If it doesn't work, you may use a sweep. In this special case a revolve could work as well.
Thanks, I will try with the newer OCC version and see how that goes. I am not sure a sweep will work because the object is attached to a rectangular section as well. I also only have a list of vertices, would the sweep work if I created a wire and passed the wire to it (including the rectangular part)?
chrisb wrote: Sun Apr 11, 2021 9:20 am I'm looking through my recent posts searching something, and found that I didn't ask for a file, so that interested helpers can play with it.
I cannot share the file I am using, but I can try to get a sample one uploaded.
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by chrisb »

Small samples showing nothing but the issue are even better.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
NilDesperandum
Posts: 27
Joined: Tue Sep 29, 2020 12:26 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by NilDesperandum »

chrisb wrote: Mon Apr 12, 2021 6:23 pm Small samples showing nothing but the issue are even better.
I have attached a file containing the problem object on top of a base layer. This shows the rectangular section as well as the curved area. This object is sometimes attached to other objects making the chamfer more complex, but the corner mentioned in the original post is the problem area at the moment.
sample_curved_chamfer.FCStd
(9.5 KiB) Downloaded 24 times
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by chrisb »

NilDesperandum wrote: Sat Apr 10, 2021 7:35 pm In short it is basically a semi-circle
No, it is not. It is a tesselated thing with near to tangent edges, and these are causing troubles. Make a semi-circle and it works:
SnipScreenshot-2afc19.png
SnipScreenshot-2afc19.png (16.06 KiB) Viewed 729 times
Attachments
sample_curved_chamfer_cb.FCStd
(19.85 KiB) Downloaded 21 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
NilDesperandum
Posts: 27
Joined: Tue Sep 29, 2020 12:26 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by NilDesperandum »

chrisb wrote: Thu Apr 15, 2021 8:31 am No, it is not. It is a tesselated thing with near to tangent edges, and these are causing troubles. Make a semi-circle and it works:
The corner is from an approximated semi-circle (using a given number of points for approximation) from KLayout. If I increase the number of points, such that it is more smooth on the top, will that have a better chance of working? Or am I off on the issue between the approximation and the real thing (semi-circle)?

The object is created from a file of vertices, so I am not quite sure how to make it an exact semi-circle.
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by chrisb »

NilDesperandum wrote: Thu Apr 15, 2021 3:34 pm If I increase the number of points, such that it is more smooth on the top, will that have a better chance of working? Or am I off on the issue between the approximation and the real thing (semi-circle)?
I haven't tested, but I don't think so. You will get closer to being tangent, but not get there. Very often the time invested to fix such models is down the drain and would have been invested better in remodeling things directly in FreeCAD.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: Any Suggestions for Chamfering Sharp Angles

Post by chrisb »

I will make some more tests, it all looks now rather confusing.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply